public IQueryJoin RightJoin(QueryDef query, string alias) { var helper = new QueryDefHelper(Def); var source = new QuerySourceDef { Alias = alias, SubQuery = query }; var join = helper.AddJoin(source, SqlSourceJoinType.RightOuter); return(new QueryJoinBuilder(this, join)); }
public IQueryExpression NotIn(QueryDef subQuery, string attribute) { var helper = new QueryDefHelper(subQuery); var subAttr = helper.AddAttribute(attribute); Condition.Right = new QueryConditionPartDef { SubQuery = new SubQueryDef { QueryDef = subQuery, Attribute = subAttr } }; //Condition.SubQueryDef = subQuery; //Condition.SubQueryAttribute = attribute; Condition.Condition = ConditionOperation.NotIn; return(GetParentExpression()); }
public string SetAlias(string alias) { var helper = new QueryDefHelper(Def); var a = QueryDefHelper.PrepareAlias(alias); if (helper.UniqueSourceAlias(a)) { Def.Source.Alias = a; } else { a = helper.GetUniqueSourceAlias(a); } return(a); }
internal override QueryConditionDef CreateConditionDef(Guid attrId, ExpressionOperation operation, string source) { var def = GetDef(); if (def != null) { var helper = new QueryDefHelper(def); var sourceDef = String.IsNullOrEmpty(source) ? null /*def.Source*/ : helper.FindSource(source); return(new QueryConditionDef { Operation = operation, Left = new QueryConditionPartDef { Attribute = helper.AddAttribute(attrId, sourceDef) } }); } return(base.CreateConditionDef(attrId, operation, source)); }
internal override QuerySourceDef FindSource(string alias) { var helper = new QueryDefHelper(Def); return(helper.FindSource(alias)); }