huysentruitw / entity-framework-core-mock

Easy Mock wrapper for mocking EFCore5 DbContext and DbSet using Moq or NSubstitute

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DBSetBackingStore.ApplyChanges always returns zero

zeynalnia opened this issue · comments

DBSetBackingStore.ApplyChanges uses _changes.Count to return number of changes, _changes is always empty because Interlocked.Exchange(ref _changes, new List<DbSetChange>()) is called before that.
suggested fix is to use changes.Count instead. (no underscores)