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.HasRequiredbut 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

Mithun PattankarRank #1,446 · 1.1K reputationPosted May 24, 2017, 12:00 AM EDT
Mithun PattankarRank #1,446 · 1.1K reputationPosted May 24, 2017, 1:12 AM EDT
neeraj gandhiRank #5,816 · 285 reputationPosted May 24, 2017, 12:09 AM EDT