Thank you! In which version will the bug fix be released?
Hi
Thanks for confirming. I've overridden the EntityHistoryHelper's GetPropertyChanges method to include the property changes of the referenced entities.
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using Volo.Abp.Auditing;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EntityFrameworkCore.EntityHistory;
using Volo.Abp.Json;
using Volo.Abp.Timing;
namespace MyCompany.MyModule;
[Dependency(ReplaceServices = true)]
public class CustomEntityHistoryHelper : EntityHistoryHelper
{
public CustomEntityHistoryHelper(
IAuditingStore auditingStore,
IOptions<AbpAuditingOptions> options,
IClock clock,
IJsonSerializer jsonSerializer,
IAuditingHelper auditingHelper)
: base(auditingStore, options, clock, jsonSerializer, auditingHelper)
{
}
protected override List<EntityPropertyChangeInfo> GetPropertyChanges(EntityEntry entityEntry)
{
List<EntityPropertyChangeInfo> propertyChanges = base.GetPropertyChanges(entityEntry);
foreach (ReferenceEntry reference in entityEntry.References)
{
if (reference.TargetEntry == null)
{
continue;
}
List<EntityPropertyChangeInfo> referencePropertyChanges = GetPropertyChanges(reference.TargetEntry);
foreach (EntityPropertyChangeInfo referencePropertyChange in referencePropertyChanges)
{
referencePropertyChange.PropertyName = $"{reference.Metadata.Name}.{referencePropertyChange.PropertyName}";
}
propertyChanges.AddRange(referencePropertyChanges);
}
return propertyChanges;
}
}
Any remarks on this approach?
Earlier versions suite was generating AppService names singular. With version 4.3 we realised suite started to generate new service names plural.
Sample: Old:
ProductAppService
New:ProductsAppService
Is this a new approach for naming convention? Or is this a bug in the templates? The generated .cs class file name is also still singular.