hi to all,
Here i want to set foregin key for employee id but while running code first migration i got a error.How to resolve it.
MODEL DESCRIPTION:-
Here i want to set foregin key for employee id but while running code first migration i got a error.How to resolve it.
MODEL DESCRIPTION:-
[Required]
[ForeignKey("Employee_Id")]
public int Employee_Id { get; set; }
ERROR DESCRIPTION:-
The property 'Employee_Id' cannot be configured as a navigation property. The property must be a valid entity type and the property should have a non-abstract getter and setter. For collection properties the type must implement ICollection where T is a valid entity type.
ERROR DESCRIPTION:-
The property 'Employee_Id' cannot be configured as a navigation property. The property must be a valid entity type and the property should have a non-abstract getter and setter. For collection properties the type must implement ICollection

Dipankar BiswasRank #992 · 2K reputationPosted Aug 1, 2014, 4:49 AM EDT
jothi kumar102 reputationPosted Aug 1, 2014, 5:58 AM EDT