mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
The advanced save condition column supports custom types
This commit is contained in:
parent
378ef5ab20
commit
9a1005a407
@ -507,6 +507,15 @@ namespace SqlSugar
|
|||||||
value = Convert.ToInt64(value);
|
value = Convert.ToInt64(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (item.SqlParameterDbType != null && item.SqlParameterDbType is Type && UtilMethods.HasInterface((Type)column.SqlParameterDbType, typeof(ISugarDataConverter)))
|
||||||
|
{
|
||||||
|
var columnInfo = item;
|
||||||
|
var type = columnInfo.SqlParameterDbType as Type;
|
||||||
|
var ParameterConverter = type.GetMethod("ParameterConverter").MakeGenericMethod(columnInfo.PropertyInfo.PropertyType);
|
||||||
|
var obj = Activator.CreateInstance(type);
|
||||||
|
var p = ParameterConverter.Invoke(obj, new object[] { value, 100 }) as SugarParameter;
|
||||||
|
value = p.Value;
|
||||||
|
}
|
||||||
condition.ConditionalList.Add(new KeyValuePair<WhereType, ConditionalModel>(i==0?WhereType.Or :WhereType.And, new ConditionalModel()
|
condition.ConditionalList.Add(new KeyValuePair<WhereType, ConditionalModel>(i==0?WhereType.Or :WhereType.And, new ConditionalModel()
|
||||||
{
|
{
|
||||||
FieldName = item.DbColumnName,
|
FieldName = item.DbColumnName,
|
||||||
|
Loading…
Reference in New Issue
Block a user