mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Synchronization code
This commit is contained in:
parent
7d930b2c6a
commit
f85cfd3600
@ -103,7 +103,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
name = column.PropertyName;
|
name = column.PropertyName;
|
||||||
}
|
}
|
||||||
var value = ValueConverter(column, PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item));
|
var value = ValueConverter(column, GetValue(item,column));
|
||||||
if (column.SqlParameterDbType != null&& column.SqlParameterDbType is Type && UtilMethods.HasInterface((Type)column.SqlParameterDbType, typeof(ISugarDataConverter)))
|
if (column.SqlParameterDbType != null&& column.SqlParameterDbType is Type && UtilMethods.HasInterface((Type)column.SqlParameterDbType, typeof(ISugarDataConverter)))
|
||||||
{
|
{
|
||||||
var columnInfo = column;
|
var columnInfo = column;
|
||||||
@ -155,6 +155,18 @@ namespace SqlSugar
|
|||||||
|
|
||||||
return dt;
|
return dt;
|
||||||
}
|
}
|
||||||
|
private static object GetValue(T item, EntityColumnInfo column)
|
||||||
|
{
|
||||||
|
if (StaticConfig.EnableAot)
|
||||||
|
{
|
||||||
|
return column.PropertyInfo.GetValue(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string GetTableName()
|
private string GetTableName()
|
||||||
{
|
{
|
||||||
if (this.AsName.HasValue())
|
if (this.AsName.HasValue())
|
||||||
|
@ -252,7 +252,7 @@ namespace SqlSugar
|
|||||||
var isMapping = IsMappingColumns;
|
var isMapping = IsMappingColumns;
|
||||||
var columnInfo = new DbColumnInfo()
|
var columnInfo = new DbColumnInfo()
|
||||||
{
|
{
|
||||||
Value = PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item),
|
Value = GetValue(item,column),
|
||||||
DbColumnName = column.DbColumnName,
|
DbColumnName = column.DbColumnName,
|
||||||
PropertyName = column.PropertyName,
|
PropertyName = column.PropertyName,
|
||||||
PropertyType = UtilMethods.GetUnderType(column.PropertyInfo),
|
PropertyType = UtilMethods.GetUnderType(column.PropertyInfo),
|
||||||
@ -316,6 +316,17 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static object GetValue(T item, EntityColumnInfo column)
|
||||||
|
{
|
||||||
|
if (StaticConfig.EnableAot)
|
||||||
|
{
|
||||||
|
return column.PropertyInfo.GetValue(item, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string GetDbColumnName(string propertyName)
|
private string GetDbColumnName(string propertyName)
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public class StaticConfig
|
public class StaticConfig
|
||||||
{
|
{
|
||||||
|
public static bool EnableAot { get; set; }
|
||||||
public static Func<string,string> Encode { get; set; }
|
public static Func<string,string> Encode { get; set; }
|
||||||
public static Func<string,string> Decode{ get; set; }
|
public static Func<string,string> Decode{ get; set; }
|
||||||
public static bool AppContext_ConvertInfinityDateTime { get; set; }
|
public static bool AppContext_ConvertInfinityDateTime { get; set; }
|
||||||
|
Loading…
Reference in New Issue
Block a user