hi sbelini
right before calling SaveChangesAsync, I check entity manager just to make sure there is only one entity exist.
And yes, there is only one entity exist.
that entity is SalesOrder with state = Added.
after calling SaveChangesAsync (in the callback function), I recheck entity manager.
Now two entity exist (where I expect it should be only one entity exist (the one before save, but with new state = Unchanged).
basically this two entity are same. first one state is Added, and the second one is Unchange (like I told in the first post).
about PK:
PK of SalesOrder is AgencyID, and SOID.
SOID is assigned right before calling SaveChangesAsync.
AgencyID is assigned in EntityServerSaveInterceptor.
my entity before save:
[0] AgencyID = 0, SOID = 72, state = Added
after save (in callback)
what I expect:
[0] AgencyID, 1, SOID, 72, state = Unchange
in reality:
[0] AgencyID = 0, SOID = 72, state = Added
[1] AgencyID, 1, SOID, 72, state = Unchange