Skip to content

Commit

Permalink
Fixes columnsFiltered
Browse files Browse the repository at this point in the history
  • Loading branch information
redbaty committed Sep 27, 2023
1 parent 5ffd07a commit ca0e343
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PgBulk/BulkOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ public async Task<NpgsqlBinaryImporter<T>> CreateBinaryImporterAsync<T>(NpgsqlCo
/// <returns></returns>
public async Task<NpgsqlBinaryImporter<T>> CreateBinaryImporterAsync<T>(NpgsqlConnection connection, IEnumerable<ITableColumnInformation> columns, string targetTableName, string? targetSchema = null)
{
var columnsFiltered = columns.Where(i => i.ValueGeneratedOnAdd).ToList();
var columnsFiltered = columns.Where(i => !i.ValueGeneratedOnAdd).ToList();

if(columnsFiltered.Count <= 0)
throw new InvalidOperationException("No valid columns found on type " + typeof(T).Name);

var columnsString = columnsFiltered
.Select(i => $"\"{i.Name}\"")
Expand Down

0 comments on commit ca0e343

Please sign in to comment.