Does Entity Framework saves related classes automatically?
- by herbatnic
Let's assume that we have such classes
public class A{
string someField { get; set; }
public virtual B B {get; set; }
}
public class B {
int someIntField {get; set; }
[ForeignKey("Id")]
[Required]
public virtual A A { get; set; }
}
In code I create new instances for both of them and making relation like:
A a = new A () {…