Update CreateObjectByType

This commit is contained in:
sunkaixuan
2023-10-11 18:28:41 +08:00
parent cf1802bdca
commit b681dcccb4

View File

@@ -51,6 +51,11 @@ namespace SqlSugar
// 获取对象中的属性
PropertyInfo propertyInfo = type.GetProperty(pair.Key);
if (propertyInfo == null)
{
propertyInfo = type.GetProperties().FirstOrDefault(it=>it.Name.EqualCase(pair.Key));
}
if (propertyInfo != null)
{
propertyInfo.SetValue(obj, UtilMethods.ChangeType2(pair.Value, propertyInfo.PropertyType));