コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void BeDirtyAfterInitialised()
 {
     builder.Where <TestEntity>(e => e.IntProperty == 1);
     builder.IsClean.Should()
     .BeFalse();
 }