mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-01 18:59:35 +08:00
Optimize merged code
This commit is contained in:
parent
42ee13947c
commit
2373de787e
@ -19,24 +19,9 @@ namespace SqlSugar
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数值类型
|
||||
/// </summary>
|
||||
static Type[] NumericalTypes = new Type[]
|
||||
{
|
||||
typeof(int),
|
||||
typeof(uint),
|
||||
typeof(byte),
|
||||
typeof(sbyte),
|
||||
typeof(long),
|
||||
typeof(ulong),
|
||||
typeof(short),
|
||||
typeof(ushort),
|
||||
};
|
||||
|
||||
public static string ToSqlValue(this object value)
|
||||
{
|
||||
if (NumericalTypes.Contains(value.GetType()))
|
||||
if (value!=null&& UtilConstants.NumericalTypes.Contains(value.GetType()))
|
||||
return value.ToString();
|
||||
|
||||
var str = value + "";
|
||||
|
@ -43,5 +43,20 @@ namespace SqlSugar
|
||||
internal static Type DicArraySO = typeof(Dictionary<string, object>);
|
||||
|
||||
public static Type SugarType = typeof(SqlSugarProvider);
|
||||
|
||||
/// <summary>
|
||||
/// 数值类型
|
||||
/// </summary>
|
||||
internal static Type[] NumericalTypes = new Type[]
|
||||
{
|
||||
typeof(int),
|
||||
typeof(uint),
|
||||
typeof(byte),
|
||||
typeof(sbyte),
|
||||
typeof(long),
|
||||
typeof(ulong),
|
||||
typeof(short),
|
||||
typeof(ushort),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user