mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 04:53:45 +08:00
Subquery
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar.ExpressionsToSql.Subquery
|
||||
{
|
||||
public class SubWhere : ISubOperation
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get { return "Where"; }
|
||||
}
|
||||
|
||||
public int Sort
|
||||
{
|
||||
get
|
||||
{
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetValue(ExpressionContext context, Expression expression = null)
|
||||
{
|
||||
var newContext = context.GetCopyContext();
|
||||
newContext.ParameterIndex = context.ParameterIndex;
|
||||
newContext.Resolve(expression, ResolveExpressType.WhereMultiple);
|
||||
context.Parameters.AddRange(newContext.Parameters);
|
||||
context.ParameterIndex = newContext.ParameterIndex;
|
||||
return newContext.Result.GetResultString();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user