|
|
|
@ -1,6 +1,7 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.ComponentModel.DataAnnotations.Schema; |
|
|
|
using System.Globalization; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq.Expressions; |
|
|
|
using System.Reflection; |
|
|
|
@ -322,9 +323,17 @@ namespace Volo.Abp.EntityFrameworkCore |
|
|
|
|
|
|
|
var entryProperty = entry.Property(property.Name); |
|
|
|
|
|
|
|
entryProperty.CurrentValue = entryProperty.Metadata.ClrType == entityProperty.GetType() |
|
|
|
? entityProperty |
|
|
|
: Convert.ChangeType(entityProperty, entryProperty.Metadata.ClrType); |
|
|
|
if (entryProperty.Metadata.ClrType == entityProperty.GetType()) |
|
|
|
{ |
|
|
|
entryProperty.CurrentValue = entityProperty; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (TypeHelper.IsPrimitiveExtended(entryProperty.Metadata.ClrType, includeEnums: true)) |
|
|
|
{ |
|
|
|
entryProperty.CurrentValue = Convert.ChangeType(entityProperty, entryProperty.Metadata.ClrType, CultureInfo.InvariantCulture); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|