I have the following entities and relationship designed using code first...
public class Parent
{
[Key]
public int Id {get;set;} //PK
public ICollection<Child1> Children{get;set;} //one to many
}
public class Child1
{
[Key]
public int Id { get; set;} //PK
[ForeignKey("Parent")]
public int ParentId {get; set;}
public Parent { get; set;}
public Child1Child Child1Child{ get; set; } //one to one Naviation
}
public class Child1Child
{
[Key, ForeignKey("Child1")]
public int Child1Id { get; set;} //PK & FK
public Child1 { get; set; } //one to one
}
Now the Question is deleting a Parent, should that not cascade the deletion to Child1 and Child1Child?
In My case entity framework Cascades up to Child1 but not Child1child. Can some shed some light on what is going on here?
Thank you in advance!