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 shown below,
- commit reference: [GenericUnitOfWorkABContrib: e402fa3d](https://genericunitofworkandrepositories.codeplex.com/SourceControl/network/forks/AGBrown/GenericUnitOfWorkABContrib/changeset/e402fa3dc8245bc048cc6bbdde4a1a43849b4ecf)
- Pull request: [7102](https://genericunitofworkandrepositories.codeplex.com/SourceControl/network/forks/AGBrown/GenericUnitOfWorkABContrib/contribution/7102)

(note: prior 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 await this.SaveChangesAsync(CancellationToken.None);
}

Viewing all articles
Browse latest Browse all 1539

Trending Articles



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