Calling `DataContext.SaveChangesAsync()` causes `DbContext` to call `DataContext.SaveChangesAsync(CancellationToken)`, meaning `base.SaveChangesAsync` and `SyncObjectsStatePostCommit` are invoked twice, once by each of the DataContext implementations.
Proposed fix below, commit reference to follow in next issue edit
Fix commit also includes documentation for the DataContext class.
_Version:_
- Last seen: [0d465a66]( https://genericunitofworkandrepositories.codeplex.com/SourceControl/changeset/0d465a6614f274d562a6bfc25059c25a10bed7b0)
_Impact:_
- performance
_Proposed fix:_
public override async Task<int> SaveChangesAsync()
{
return this.SaveChangesAsync(CancellationToken.None); // no need for await here
}
Proposed fix below, commit reference to follow in next issue edit
Fix commit also includes documentation for the DataContext class.
_Version:_
- Last seen: [0d465a66]( https://genericunitofworkandrepositories.codeplex.com/SourceControl/changeset/0d465a6614f274d562a6bfc25059c25a10bed7b0)
_Impact:_
- performance
_Proposed fix:_
public override async Task<int> SaveChangesAsync()
{
return this.SaveChangesAsync(CancellationToken.None); // no need for await here
}