public IDriver <T> JoinWhere <T1>(Expression <Func <T, T1, Boolean> > predicate) where T1 : class { this.SQLComponent.AppendWhere(); LambdaToSqlConverter <T> .JoinWhere <T1>(this.DbProvider, predicate, this.SQLComponent); return(this); }
public IDriver <T> JoinOn <T1>(Expression <Func <T, T1, Boolean> > predicate) where T1 : class { this.SQLComponent.AppendSQLFormat(CommonFormat.JOIN_ON_FORMAT, Table <T1> .Schema.TableName, String.Empty); LambdaToSqlConverter <T> .JoinOn <T1>(this.DbProvider, predicate, this.SQLComponent); return(this); }
/*.................更新.................*/ public static IDriver <T> Update <T>(this Table <T> tableObj, Expression <Func <T> > regenerator) where T : class { IDriver <T> driver = tableObj.DbProvider.Driver <T>(); LambdaToSqlConverter <T> .UpdateConvert(tableObj.DbProvider, regenerator, driver.SQLComponent); return(driver); }
public IDriver <T> OrWhere(Expression <Func <T, Boolean> > predicate) { this.SQLComponent.AppendWhere(false); SQLComponent component = new SQLComponent(); LambdaToSqlConverter <T> .WhereConvert(this.DbProvider, predicate, component); this.SQLComponent.AppendSQLFormat(CommonFormat.BRACKET_FORMAT, component.SQL); this.SQLComponent.AddParameters(component.Parameters); return(this); }
public static IDriver <T> Select <T>(this Table <T> tableObj, Expression <Func <T, dynamic> > selector) where T : class { String selectSql = LambdaToSqlConverter <T> .SelectConvert(tableObj.DbProvider.ConflictFreeFormat, selector); if (String.IsNullOrEmpty(selectSql)) { return(Select <T>(tableObj)); } IDriver <T> driver = tableObj.DbProvider.Driver <T>(); driver.SQLComponent.AppendSQL(selectSql); return(driver); }