Closed cryo75 closed 9 years ago
I'm using UpdateGraph also for inserting entiies, as follows:
public override void Add(Customer entity) { this.Update(entity); } public override Customer Update(Customer entity) { return ((DbContext)dataContext).UpdateGraph<Customer > (entity, map => map.AssociatedEntity(x => x.CustomerType) ); }
However, Customer id is still 0 after calling SaveChanges. The customer is still being added in the db with a valid id.
What could be wrong here?
In this code sample, you aren't using the return value of UpdateGraph, so you don't have a reference to the updated entity.
Thats that did the trick.!
I'm using UpdateGraph also for inserting entiies, as follows:
However, Customer id is still 0 after calling SaveChanges. The customer is still being added in the db with a valid id.
What could be wrong here?