mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update exp to sql
This commit is contained in:
@@ -16,6 +16,10 @@ namespace SqlSugar
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
public T End<T>()
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
public class CaseThen
|
||||
{
|
||||
|
@@ -45,8 +45,15 @@ namespace SqlSugar
|
||||
{
|
||||
var isFirst = allMethods.First() == methodExp;
|
||||
var isLast = allMethods.Last() == methodExp;
|
||||
var sql = SubTools.GetMethodValue(this.context, methodExp.Arguments[0], this.context.IsSingle ? ResolveExpressType.WhereSingle : ResolveExpressType.WhereMultiple);
|
||||
sqls.Add(new KeyValuePair<string, string>(methodExp.Method.Name, sql));
|
||||
if (methodExp.Arguments.Count == 0)
|
||||
{
|
||||
sqls.Add(new KeyValuePair<string, string>(methodExp.Method.Name, "null"));
|
||||
}
|
||||
else
|
||||
{
|
||||
var sql = SubTools.GetMethodValue(this.context, methodExp.Arguments[0], this.context.IsSingle ? ResolveExpressType.WhereSingle : ResolveExpressType.WhereMultiple);
|
||||
sqls.Add(new KeyValuePair<string, string>(methodExp.Method.Name, sql));
|
||||
}
|
||||
}
|
||||
var result = this.context.DbMehtods.CaseWhen(sqls);
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user