Update exp to sql

This commit is contained in:
sunkaixuan 2023-07-25 12:29:15 +08:00
parent 2d214c3d52
commit 5576c68142

View File

@ -127,7 +127,11 @@ namespace SqlSugar
case ResolveExpressType.FieldMultiple:
if (express.Method.Name == "ToString" && express.Object != null && express.Object?.Type == UtilConstants.DateType)
{
var format = (args[0] as ConstantExpression).Value + "";
var format = (args[0] as ConstantExpression)?.Value + "";
if (format == ""&& args[0] is MemberExpression)
{
format = ExpressionTool.GetExpressionValue(args[0]) + "";
}
var value = GetNewExpressionValue(express.Object);
var dateString2 = this.Context.DbMehtods.GetDateString(value, format);
if (dateString2 == null)