Open 2501272126 opened 1 month ago
hi
Can you try to override the HandlePropertiesBeforeSave
method of AbpDbContext
.
protected virtual void HandlePropertiesBeforeSave()
{
var entries = ChangeTracker.Entries().ToList();
foreach (var entry in entries)
{
HandleExtraPropertiesOnSave(entry);
if (entry.State.IsIn(EntityState.Modified, EntityState.Deleted))
{
UpdateConcurrencyStamp(entry);
}
}
if (EntityChangeOptions.Value.PublishEntityUpdatedEventWhenNavigationChanges)
{
foreach (var entry in AbpEfCoreNavigationHelper.GetChangedEntityEntries().Where(x => x.State == EntityState.Unchanged))
{
UpdateConcurrencyStamp(entry);
}
}
}
code example:
when i update the Name field ConcurrencyStamp is worked, but when i update the DateRange or Items , database has changed and the ConcurrencyStamp not update.