Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 protected SqlInsertBuilderBase Where(params Operator[] operators)
 {
     WhereBlock.AddRange(operators);
     CurrentPosition = SqlInsertPosition.Where;
     return(this);
 }
Esempio n. 3
0
 protected SqlInsertBuilderBase DoNothing()
 {
     DoNothingBlock  = new DoNothingBlock();
     CurrentPosition = SqlInsertPosition.Do;
     return(this);
 }
Esempio n. 4
0
 protected SqlInsertBuilderBase DoUpdate(IEnumerable <SqlColumn> sqlColumns)
 {
     DoUpdateBlock.AddRange(sqlColumns.Select(m => new OnConflictUpdateValueBlock(m)));
     CurrentPosition = SqlInsertPosition.Do;
     return(this);
 }
Esempio n. 5
0
 protected SqlInsertBuilderBase OnConflict(IEnumerable <string> sqlColumns)
 {
     ConflictUpdate.AddRange(sqlColumns.Select(m => new ColumnEntity(m)));
     CurrentPosition = SqlInsertPosition.Conflict;
     return(this);
 }
Esempio n. 6
0
 protected SqlInsertBuilderBase(SqlTable sqlTable)
 {
     SqlTable        = sqlTable;
     InsertIntoBlock = new InsertIntoBlock(new TableEntity(sqlTable ?? throw new ArgumentException(nameof(sqlTable))));
     CurrentPosition = SqlInsertPosition.Into;
 }
Esempio n. 7
0
 protected SqlInsertBuilderBase Returns(IEnumerable <SqlColumn> sqlColumns)
 {
     ReturningBlock.AddRange(sqlColumns.Select(m => new ColumnAsPropertyEntity(m)));
     CurrentPosition = SqlInsertPosition.Return;
     return(this);
 }