mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 20:43:46 +08:00
Synchronization code
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@@ -145,11 +146,18 @@ namespace SqlSugar
|
|||||||
foreach (var item in kv.ToList())
|
foreach (var item in kv.ToList())
|
||||||
{
|
{
|
||||||
var itemIndex=dataReader.GetOrdinal(item.DbColumnName);
|
var itemIndex=dataReader.GetOrdinal(item.DbColumnName);
|
||||||
|
if (item.SqlParameterDbType is Type&&item.UnderType.IsEnum && dataReader.GetValue(itemIndex) is string value)
|
||||||
|
{
|
||||||
|
item.PropertyInfo.SetValue(parentObj,UtilMethods.ChangeType2(value, item.PropertyInfo.PropertyType));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
item.PropertyInfo.SetValue(parentObj, dataReader.GetValue(itemIndex));
|
item.PropertyInfo.SetValue(parentObj, dataReader.GetValue(itemIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void FormatT<T>(T addItem)
|
private void FormatT<T>(T addItem)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user