I have these entities:
public class StudentBag
{
public int BagIdentifier { get; set; }
public Student Student { get; set; }
}
public class Student
{
public string Name { get; set; }
public StudentBag StudentBag{get;set;}
}
I want to configure a one to one relationship. my question is if there is a difference between:
modelBuilder.Entity<StudentBag>()
.HasRequired(t => t.Student)
.WithRequiredDependent(t=>t.StudentBag);
modelBuilder.Entity<StudentBag>()
.HasRequired(t => t.Student)
.WithRequiredPrincipal(t => t.StudentBag);
and I will appreciate if someone will explain what it is mean principle and dependent...