I have a class:
public class Foo {
public Guid Id { get; set; }
public Bar Child { get; set; }
}
When I insert into Foo
via context.Foos.Add(myFoo)
, a Bar
is being inserted into the database if it is not null.
How can I prevent this from happening? Do I have to set Child to null prior to inserting into the context?