Update .net core project

This commit is contained in:
sunkaixuan
2022-08-18 22:16:16 +08:00
parent 0006f9444c
commit c9582a9ece
4 changed files with 25 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ namespace SqlSugar
if (thisValue == null) return 0;
if (thisValue is Enum)
{
return (int)thisValue;
return Convert.ToInt32(thisValue);
}
if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval))
{
@@ -22,6 +22,21 @@ namespace SqlSugar
return reval;
}
public static long ObjToLong(this object thisValue)
{
long reval = 0;
if (thisValue == null) return 0;
if (thisValue is Enum)
{
return Convert.ToInt64(thisValue);
}
if (thisValue != null && thisValue != DBNull.Value && long.TryParse(thisValue.ToString(), out reval))
{
return reval;
}
return reval;
}
public static int ObjToInt(this object thisValue, int errorValue)
{
int reval = 0;