diff --git a/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs b/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs index 1b1d8d290..653a20412 100644 --- a/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs +++ b/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs @@ -16,13 +16,34 @@ namespace SqlSugar { return thisValue.IsValuable(); } - public static bool IsNullOrEmpty(object thisValue) { throw new NotImplementedException(); } - public static string ToLower(object thisValue) { throw new NotImplementedException(); } - public static string ToUpper(object thisValue) { throw new NotImplementedException(); } - public static string Trim(object thisValue) { throw new NotImplementedException(); } - public static bool Contains(string thisValue, string parameterValue) { throw new NotImplementedException(); } - public static bool ContainsArray(T[] thisValue, object parameterValue) { throw new NotImplementedException(); } - public static bool StartsWith(object thisValue, string parameterValue) { throw new NotImplementedException(); } + public static bool IsNullOrEmpty(object thisValue) + { + return thisValue.IsNullOrEmpty(); + } + public static string ToLower(object thisValue) + { + return thisValue == null ? null : thisValue.ToString().ToLower(); + } + public static string ToUpper(object thisValue) + { + return thisValue == null ? null : thisValue.ToString().ToUpper(); + } + public static string Trim(object thisValue) + { + return thisValue == null ? null : thisValue.ToString().Trim(); + } + public static bool Contains(string thisValue, string parameterValue) + { + return thisValue.Contains(parameterValue); + } + public static bool ContainsArray(T[] thisValue, object parameterValue) + { + return thisValue.Contains((T)parameterValue); + } + public static bool StartsWith(string thisValue, string parameterValue) + { + return thisValue.StartsWith(parameterValue); + } public static bool EndsWith(object thisValue, string parameterValue) { throw new NotImplementedException(); } public new static bool Equals(object thisValue, object parameterValue) { throw new NotImplementedException(); } public static bool DateIsSame(DateTime date1, DateTime date2) { throw new NotImplementedException(); }