TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jothi kumar
1.6k
107
55.9k
how to set foregin key in model
Aug 1 2014 7:41 AM
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:-
[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.
Reply
Answers (
2
)
plz any one write code for to get age of a person in mvc4
code for registration in asp.net mvc application