Optimize merged code

This commit is contained in:
skx 2021-02-05 13:04:07 +08:00
parent 42ee13947c
commit 2373de787e
2 changed files with 16 additions and 16 deletions

View File

@ -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 + "";

View File

@ -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),
};
}
}