File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ namespace BulkOperations
14
14
* https://github.com/mgravell/fast-member
15
15
*
16
16
* Update if exist https://stackoverflow.com/questions/12521692/c-sharp-bulk-insert-sqlbulkcopy-update-if-exists/12535726
17
+ * https://stackoverflow.com/questions/33027246/insert-object-or-update-if-it-already-exists-using-bulkcopy-c-sql
17
18
* https://www.databasejournal.com/features/mssql/article.php/3739131/UPSERT-Functionality-in-SQL-Server-2008.htm
18
19
* https://stackoverflow.com/questions/4889123/any-way-to-sqlbulkcopy-insert-or-update-if-exists
19
20
*/
@@ -50,9 +51,9 @@ private static void MapEntity(this SqlBulkCopy bulk)
50
51
{
51
52
// https://stackoverflow.com/questions/40470357/importing-a-csv-using-sqlbulkcopy-with-asp-net-core
52
53
bulk . DestinationTableName = "Customer" ;
53
- bulk . ColumnMappings . Add ( nameof ( Customer . Id ) , "Id" ) ;
54
- bulk . ColumnMappings . Add ( nameof ( Customer . FirstName ) , "FirstName" ) ;
55
- bulk . ColumnMappings . Add ( nameof ( Customer . LastName ) , "LastName" ) ;
54
+ bulk . ColumnMappings . Add ( nameof ( Customer . Id ) , "Id" ) ;
55
+ bulk . ColumnMappings . Add ( nameof ( Customer . FirstName ) , "FirstName" ) ;
56
+ bulk . ColumnMappings . Add ( nameof ( Customer . LastName ) , "LastName" ) ;
56
57
bulk . ColumnMappings . Add ( nameof ( Customer . DateOfBirth ) , "DateOfBirth" ) ;
57
58
}
58
59
You can’t perform that action at this time.
0 commit comments