public static IWhereResult <T, TMe> WhereSub <T, TMe>(this IWhereTarget <T, TMe> fluentBuilder, Action <IAndWhereTarget <T, TMe> > expression) { fluentBuilder.AppendWhere(); fluentBuilder.QueryBuilder.StringBuilder.Append("("); expression((IAndWhereTarget <T, TMe>)fluentBuilder); fluentBuilder.QueryBuilder.StringBuilder.AfterSubExpression(); fluentBuilder.CurrentContext = QueryContext.Where; return((IWhereResult <T, TMe>)fluentBuilder); }
public static IWhereResult <T, TMe> Where <T, TMe>(this IWhereTarget <T, TMe> fluentBuilder, Action <ISelectResult <T, TMe> > subQuery, SubQueryType type) { fluentBuilder.AppendWhere(); switch (type) { case SubQueryType.Exists: fluentBuilder.QueryBuilder.StringBuilder.AppendAfterSpace("EXISTS"); break; case SubQueryType.NotExists: fluentBuilder.QueryBuilder.StringBuilder.AppendAfterSpace("NOT EXISTS"); break; } fluentBuilder.SubQuery(subQuery); return((IWhereResult <T, TMe>)fluentBuilder); }
public static IWhereResult <T, TMe> Where <T, TMe>(this IWhereTarget <T, TMe> fluentBuilder, Expression <Func <T, TMe, bool> > expression) { fluentBuilder.AppendWhere(); fluentBuilder.QueryBuilder.AddBooleanExpression(expression.Body); return((IWhereResult <T, TMe>)fluentBuilder); }