/// <summary> /// Join是否已经存在 /// </summary> /// <param name="forgeinTable">关联表</param> /// <param name="joinType">Join类型</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns> /// <remarks> /// <para>创建:Teddy</para> /// <para>日期:2016-10-17</para> /// </remarks> internal bool ExitJoin(TableSchema forgeinTable, JoinType joinType = JoinType.INNER) { var tableName = forgeinTable.GetTableName(); var joinStruct = new TableStruct { TableOrViewAliasName = forgeinTable.TableAliasName, TableOrViewName = tableName, JoinType = joinType }; return(joins.ContainsKey(joinStruct)); }
/// <summary> /// Joins the specified forgein table. /// </summary> /// <param name="forgeinTable">The forgein table.</param> /// <param name="onWhere">The on where.</param> /// <param name="joinType">Type of the join.</param> /// <returns>FromClip.</returns> /// <exception cref="NameDuplicatedException">In joins list: tableName - + tableName</exception> /// <remarks><para>创建:Teddy</para> /// <para>日期:2016-9-7</para></remarks> public FromClip Join(TableSchema forgeinTable, WhereClip onWhere, JoinType joinType = JoinType.INNER) { var tableName = forgeinTable.GetTableName(); var joinStruct = new TableStruct { TableOrViewAliasName = forgeinTable.TableAliasName, TableOrViewName = tableName, JoinType = joinType }; if (joins.ContainsKey(joinStruct)) { throw new NameDuplicatedException("In joins list: tableName - " + tableName); } joins.Add(joinStruct, new KeyValuePair <string, WhereClip>(tableName, onWhere)); return(this); }