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