Skip to content

Entity Framework Core issue with bulk delete and create

Notifications You must be signed in to change notification settings

iberodev/EntityFramework6873

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EntityFramework6873

This is a Sample project created with ASP.NET Core 1.0.1 and EF Core 1.0.1 to show the issue with [the bulk delete and create problem] (dotnet/efcore#6873)

Instructions to reproduce

  • Clone this repository
git clone https://github.com/iberodev/EntityFramework6873.git
  • Restore all the dependencies
cd EntityFramework6873
dotnet restore
  • Go to the main project
cd EntityFramework6873/src/BulkDeleteAndCreate
dotnet run

Update solution

As per [my answer here] (dotnet/efcore#6873 (comment)) it seems that the alternate key was causing the issue and the problem is gone when using an index to enforce uniqueness rather than the alternate key.

//entityBuilder.HasAlternateKey(t => new { t.UserId, t.GroupId });
entityBuilder.HasIndex(t => new { t.UserId, t.GroupId });

About

Entity Framework Core issue with bulk delete and create

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published