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