-
-
Save dcomartin/6e90fb8abacc639090371ef891856f3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) | |
.ToArray(); | |
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