Entity Framework - adding new items via a navigation property
- by Robert
I have come across what appears to be very peculiar behaviour using entity framework 4.0.
I have a User entity, which has a Company (A Company has many Users).
If I do this, everything works as expected and I get a nice shiny new user in the database:
var company = _model.Companies.First();
company.Users.Add(new User(1, "John", "Smith"));…