Closed willisga closed 3 years ago
BulkConfig has CustomDestinationTableName
.
There is Example of usage in TablePerTypeInsertTest:
https://github.com/borisdj/EFCore.BulkExtensions/blob/e6cea2398b64a3d81fd38860e79857f75a16913d/EFCore.BulkExtensions.Tests/EFCoreBulkTestAtypical.cs#L703
Hello, thank you very much for solving the issue 629
The following exception occurs when the destination table (Merge) is not associated with an entity.
Exception Line : https://github.com/borisdj/EFCore.BulkExtensions/blob/e6cea2398b64a3d81fd38860e79857f75a16913d/EFCore.BulkExtensions/TableInfo.cs#L172
Message: Sequence contains no matching element StackTrace:
Here's an image to provide a bit of context
To solve the exception create an option in the bulk config that allows me to assign the name of the target table that I will assign in the merge without affecting the current TableInfo processes.
BulkConfig.cs: https://github.com/borisdj/EFCore.BulkExtensions/blob/master/EFCore.BulkExtensions/BulkConfig.cs
Table Info.cs https://github.com/borisdj/EFCore.BulkExtensions/blob/master/EFCore.BulkExtensions/TableInfo.cs
Add Properties
Update Method
LoadData<T>(DbContext context, Type type, IList<T> entities, bool loadOnlyPKColumn)
SqlQueryBuilder.cs File: https://github.com/borisdj/EFCore.BulkExtensions/blob/master/EFCore.BulkExtensions/SqlQueryBuilder.cs
Debugger:
Query Result:
I do not know if it is the correct way but I will be attentive to provide more information and to help in the most optimal solution defined by the repo administrator.