예제 #1
0
 /// <summary>
 /// 关联表信息
 /// </summary>
 /// <param name="table"></param>
 /// <param name="where"></param>
 public QueryCreator Join(JoinType joinType, Table table, WhereClip where)
 {
     if (!this.joinTables.ContainsKey(table.OriginalName))
     {
         TableJoin join = new TableJoin()
         {
             Table = table,
             Type  = JoinType.LeftJoin,
             Where = where
         };
         this.joinTables.Add(table.OriginalName, join);
     }
     return(this);
 }
예제 #2
0
        /// <summary>
        /// 关联表信息
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="where"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public QueryCreator Join(JoinType joinType, string tableName, string where, params SQLParameter[] parameters)
        {
            Table t = new Table(tableName);

            if (!this.joinTables.ContainsKey(t.OriginalName))
            {
                TableJoin join = new TableJoin()
                {
                    Table = t,
                    Type  = joinType,
                    Where = new WhereClip(where, parameters)
                };
                this.joinTables.Add(t.OriginalName, join);
            }
            return(this);
        }