Skip to content

Commit 4c5921a

Browse files
author
Cesar Romero Silva
committed
* Links updated
1 parent d9a1e86 commit 4c5921a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

BulkOperation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace BulkOperations
1414
* https://github.com/mgravell/fast-member
1515
*
1616
* 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
1718
* https://www.databasejournal.com/features/mssql/article.php/3739131/UPSERT-Functionality-in-SQL-Server-2008.htm
1819
* https://stackoverflow.com/questions/4889123/any-way-to-sqlbulkcopy-insert-or-update-if-exists
1920
*/
@@ -50,9 +51,9 @@ private static void MapEntity(this SqlBulkCopy bulk)
5051
{
5152
// https://stackoverflow.com/questions/40470357/importing-a-csv-using-sqlbulkcopy-with-asp-net-core
5253
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");
5657
bulk.ColumnMappings.Add(nameof(Customer.DateOfBirth), "DateOfBirth");
5758
}
5859

0 commit comments

Comments
 (0)