Synchronization code

This commit is contained in:
sunkaixuan 2023-05-12 17:22:39 +08:00
parent 80d5a14b70
commit 1552785121

View File

@ -746,7 +746,16 @@ namespace SqlSugar
{
var propertyName = kv.Key.Replace("SugarNav_", "");
var propertyInfo = columns.First(i => i.PropertyName == propertyName).PropertyInfo;
propertyInfo.SetValue(addItem, kv.Value);
if (kv.Value is decimal &&UtilMethods.GetUnderType(propertyInfo.PropertyType).IsIn(typeof(int), typeof(long)))
{
var changeValue = UtilMethods.ChangeType2(kv.Value, propertyInfo.PropertyType);
propertyInfo.SetValue(addItem, changeValue);
}
else
{
propertyInfo.SetValue(addItem, kv.Value);
}
}
(outList as IList).Add(addItem);
index++;