Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

Edited Issue: DataContext.SaveChangesAsync() causes double state sync [1231]

$
0
0
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
}

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>