From 7194435de016c6bfdfb3144cc0031afa6de44b10 Mon Sep 17 00:00:00 2001 From: skx <610262374@qq.com> Date: Thu, 7 Jan 2021 11:29:43 +0800 Subject: [PATCH] Code optimization --- Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs | 2 +- .../ResolveItems/MethodCallExpressionResolve.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs index 9a920521c..bab22ce28 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs @@ -120,7 +120,7 @@ namespace SqlSugar public static TResult AggregateMax(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); } public static int AggregateCount(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); } public static int AggregateDistinctCount(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); } - public static TResult MappingColumn(TResult oldColumnName,string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); } + public static TResult MappingColumn(TResult type,string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); } /// ///Example: new NewT(){name=SqlFunc.GetSelfAndAutoFill(it)} Generated SQL it.* /// diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs index 7d793e0a1..bf683519a 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs @@ -652,7 +652,7 @@ namespace SqlSugar case "MappingColumn": var mappingColumnResult = this.Context.DbMehtods.MappingColumn(model); var isValid = model.Args[0].IsMember && model.Args[1].IsMember == false; - Check.Exception(!isValid, "SqlFunc.MappingColumn parameters error, The property name on the left, string value on the right"); + //Check.Exception(!isValid, "SqlFunc.MappingColumn parameters error, The property name on the left, string value on the right"); this.Context.Parameters.RemoveAll(it => it.ParameterName == model.Args[1].MemberName.ObjToString()); return mappingColumnResult; case "IsNull":