Browse Source

Merge pull request #8602 from abpframework/extension-property-dbfix

Extension Property DB Mapping Fix For Enums
pull/8605/head
Halil İbrahim Kalkan 5 years ago
committed by GitHub
parent
commit
8a31807f36
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs

4
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs

@ -349,6 +349,10 @@ namespace Volo.Abp.EntityFrameworkCore
{
entryProperty.CurrentValue = TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(entityProperty.ToString());
}
else if (conversionType.IsEnum)
{
entryProperty.CurrentValue = Enum.ToObject(conversionType, entityProperty);
}
else
{
entryProperty.CurrentValue = Convert.ChangeType(entityProperty, conversionType, CultureInfo.InvariantCulture);

Loading…
Cancel
Save