Skip to content

Instantly share code, notes, and snippets.

Created Nov 18, 2020
What would you like to do?
public override async Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
var modifiedProducts = base.ChangeTracker.Entries<ProductModel>()
.Where(x => x.State == EntityState.Modified)
.Select(entry => new ProductModified {ProductId = entry.Entity.Id})
var result = await base.SaveChangesAsync(cancellationToken);
await _messageBus.Publish(modifiedProducts);
return result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment