Example #1
0
        public IQuery Join(QueryDef query, string alias, Action <IQueryExpression> conditionAction)
        {
            var source = new QuerySourceDef
            {
                SubQuery = query,
                Alias    = alias
            };
            var joinDef = new QueryJoinDef
            {
                Operation = SqlSourceJoinType.Inner,
                Source    = source
            };

            Def.Sources.Add(source);
            var expBuilder = new QueryJoinBuilder(this, joinDef);

            Def.Joins.Add(joinDef);
            conditionAction.Invoke(expBuilder);
            return(this);
        }
Example #2
0
        public IQuery FullJoin(string docDefName, string alias, Action <IQueryExpression> conditionAction)
        {
            var source = new QuerySourceDef
            {
                DocDefName = docDefName,
                Alias      = alias
            };

            Def.Sources.Add(source);
            var joinDef = new QueryJoinDef
            {
                Operation = SqlSourceJoinType.FullOuter,
                Source    = source
            };

            var expBuilder = new QueryJoinBuilder(this, joinDef);

            Def.Joins.Add(joinDef);
            conditionAction.Invoke(expBuilder);
            return(this);
        }
Example #3
0
        public IQuery Join(Guid docDefId, string alias, Action <IQueryExpression> conditionAction)
        {
            var source = new QuerySourceDef
            {
                DocDefId = docDefId,
                Alias    = alias
            };
            var joinDef = new QueryJoinDef
            {
                Operation = SqlSourceJoinType.Inner,
                Source    = source/*,
                                   * Conditions = expBuilder.Conditions*/
            };

            Def.Sources.Add(source);

            var expBuilder = new QueryJoinBuilder(this, joinDef);

            Def.Joins.Add(joinDef);
            conditionAction.Invoke(expBuilder);
            return(this);
        }