abp icon indicating copy to clipboard operation
abp copied to clipboard

The database value did not change during the AbpJsonValue Converter update

Open 632374118 opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

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.

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

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

Version

8.0.5

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

632374118 avatar Jun 25 '24 09:06 632374118