protected SqlInsertBuilderBase Values(IEnumerable <SqlColumn> sqlColumns) { var mapItems = sqlColumns as SqlColumn[] ?? sqlColumns.ToArray(); InsertColumnsBlock.AddRange(mapItems.Select(m => new ColumnEntity(m))); InsertValuesBlock.AddRange(mapItems.Select(m => m.Property())); CurrentPosition = SqlInsertPosition.Values; return(this); }
protected SqlInsertBuilderBase Where(params Operator[] operators) { WhereBlock.AddRange(operators); CurrentPosition = SqlInsertPosition.Where; return(this); }
protected SqlInsertBuilderBase DoNothing() { DoNothingBlock = new DoNothingBlock(); CurrentPosition = SqlInsertPosition.Do; return(this); }
protected SqlInsertBuilderBase DoUpdate(IEnumerable <SqlColumn> sqlColumns) { DoUpdateBlock.AddRange(sqlColumns.Select(m => new OnConflictUpdateValueBlock(m))); CurrentPosition = SqlInsertPosition.Do; return(this); }
protected SqlInsertBuilderBase OnConflict(IEnumerable <string> sqlColumns) { ConflictUpdate.AddRange(sqlColumns.Select(m => new ColumnEntity(m))); CurrentPosition = SqlInsertPosition.Conflict; return(this); }
protected SqlInsertBuilderBase(SqlTable sqlTable) { SqlTable = sqlTable; InsertIntoBlock = new InsertIntoBlock(new TableEntity(sqlTable ?? throw new ArgumentException(nameof(sqlTable)))); CurrentPosition = SqlInsertPosition.Into; }
protected SqlInsertBuilderBase Returns(IEnumerable <SqlColumn> sqlColumns) { ReturningBlock.AddRange(sqlColumns.Select(m => new ColumnAsPropertyEntity(m))); CurrentPosition = SqlInsertPosition.Return; return(this); }