..I tried the dbSet.AsNoTracking(). But Still continue to get the ""System.InvalidOperationException: Attaching an entity of type 'NS.Models.EntityName' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any e........."
I can see that my "_dbSet.Local" has items in it. Even though I am setting the ObjectState to ObjectState.Modified before the Attach, the update still failed with the above error.
Any feedback will be appreciated.
thanks.
I can see that my "_dbSet.Local" has items in it. Even though I am setting the ObjectState to ObjectState.Modified before the Attach, the update still failed with the above error.
Any feedback will be appreciated.
thanks.