abp icon indicating copy to clipboard operation
abp copied to clipboard

AbpJsonValueComparer

Open 632374118 opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I Have a Entity: public class ProductEntity : AuditedEntity { public string Name { get; set; } public List<ProductContent>ProductEntityContent { get; set; } } public class ProductContent { public string? ProductCode { get; set; }

public string? ProductSpecification { get; set; }

public string? BatchCode { get; set; }

} I use the code below to configure EFCore: builder.Property(propertyInfo.Name).HasConversion(new AbpJsonValueConverter<TProperty>());

I encountered a warning while performing database migration: The property 'ProductEntity.StockEntryRequestContent' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly.

And when I execute the update method, ProductEntityContent is not updated to the database.

After checking the official documentation of EFCore, I found that a Value Comparer is required, but the ABP framework does not provide it

Describe the solution you'd like

Expected to add an AbpJsonValue Comparer

Additional context

No response

632374118 avatar Jun 25 '24 03:06 632374118