mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Optimized code
This commit is contained in:
parent
49c1509d53
commit
df8ca842d3
@ -141,6 +141,10 @@ namespace SqlSugar
|
||||
|
||||
public static DateTime ObjToDate(this object thisValue)
|
||||
{
|
||||
if (thisValue is DateTime)
|
||||
{
|
||||
return (DateTime)thisValue;
|
||||
}
|
||||
DateTime reval = DateTime.MinValue;
|
||||
if (thisValue != null && thisValue != DBNull.Value && DateTime.TryParse(thisValue.ToString(), out reval))
|
||||
{
|
||||
@ -151,6 +155,10 @@ namespace SqlSugar
|
||||
|
||||
public static DateTime ObjToDate(this object thisValue, DateTime errorValue)
|
||||
{
|
||||
if (thisValue is DateTime)
|
||||
{
|
||||
return (DateTime)thisValue;
|
||||
}
|
||||
DateTime reval = DateTime.MinValue;
|
||||
if (thisValue != null && thisValue != DBNull.Value && DateTime.TryParse(thisValue.ToString(), out reval))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user