mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Optimize merged code
This commit is contained in:
@@ -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)
|
public static string ToSqlValue(this object value)
|
||||||
{
|
{
|
||||||
if (NumericalTypes.Contains(value.GetType()))
|
if (value!=null&& UtilConstants.NumericalTypes.Contains(value.GetType()))
|
||||||
return value.ToString();
|
return value.ToString();
|
||||||
|
|
||||||
var str = value + "";
|
var str = value + "";
|
||||||
|
@@ -43,5 +43,20 @@ namespace SqlSugar
|
|||||||
internal static Type DicArraySO = typeof(Dictionary<string, object>);
|
internal static Type DicArraySO = typeof(Dictionary<string, object>);
|
||||||
|
|
||||||
public static Type SugarType = typeof(SqlSugarProvider);
|
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),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user