public IDeleteStatement <TEntity> Where(Expression <Func <TEntity, bool> > expression) { if (entity != null) { throw new InvalidOperationException("Where cannot be used once For has been used, please use FromScratch to reset the statement before using Where."); } IsClean = false; whereClauseBuilder.Where(expression, null, TableName, TableSchema); return(this); }
public IUpdateStatement <TEntity> Where(Expression <Func <TEntity, bool> > expression) { if (entity != null) { throw new InvalidOperationException("Where cannot be used once For has been used, please create a new command."); } IsClean = false; whereClauseBuilder.Where(expression, null, GetTableName(), null); return(this); }
public IUpdateStatement <TEntity> Where( Expression <Func <TEntity, bool> > expression) { if (entity != null) { throw new InvalidOperationException("实例模式更新时,不能指定 Where 语句。"); } IsClean = false; if (whereAllreadyAdd) { And(expression); } else { whereAllreadyAdd = true; whereClauseBuilder.Where(expression, null, GetTableName(), null); } return(this); }
public void BeDirtyAfterInitialised() { builder.Where <TestEntity>(e => e.IntProperty == 1); builder.IsClean.Should() .BeFalse(); }