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
neeraj gandhi
1.4k
299
57.3k
Entity Framework
May 23 2017 11:54 PM
i have two class employee and department
public class Employee
{
public int EmployeeId { get; set; }
public string Name { get; set; }
public string Gender { get; set; }
public string City { get; set; }
// navigation property
public Department department{get;set;}
}
public class Department
{
public int ID { get; set; }
public string Department { get; set; }
// navigation property
public Employee employee{get;set;}
}
// this is the property i have set for one to one relation ship
this.HasRequired<Department>(dep => dep.department).WithOptional(emp => emp.employee).WillCascadeOnDelete(false);
but when i check in sql server i dont find a column in employee table
which refernce to forgein key column of department .
hence during insert in sql server i get error forgein key error
Reply
Answers (
3
)
Messagebox to show failure or success message
Linq works faster ?