Way to retrieve generated identity values for bulk inserted entities?
Opened this issue · 1 comments
With straight EF Core, calling MyDbContext.MyEntities.AddRange(someEntities)
followed by MyDbContext.SaveChanges()
results in someEntities
having their Id
column being populated with those generated by Sql Server; is there any way to accomplish the same with MyDbContext.BulkInsertAsync<MyEntity>()
? Note that I am using version 2.0 of your library.
On an unrelated note, any plans to add Upsert functionality to 2.0, or is that only supported with EF 5.0?
At the moment, BulkInsertAsync
doesn't populate columns generated by the database. I may add support for that in the future, but not any time soon because my customers are generating Guids
in .NET, so there is no real demand for this feature.
As for bulk-upsert, it is implemented in v3 already: documentation