From 182eb190cf09c2a4b84e547b0c5db0c6e9f8832f Mon Sep 17 00:00:00 2001 From: Victor Irzak Date: Sun, 13 Feb 2022 19:39:00 -0500 Subject: [PATCH] BulkInsert is not working --- OwnedEntityWithUniqueIndex/OwnedEntityWithUniqueIndex.csproj | 1 + OwnedEntityWithUniqueIndex/Program.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OwnedEntityWithUniqueIndex/OwnedEntityWithUniqueIndex.csproj b/OwnedEntityWithUniqueIndex/OwnedEntityWithUniqueIndex.csproj index 367e5fd..6738b94 100644 --- a/OwnedEntityWithUniqueIndex/OwnedEntityWithUniqueIndex.csproj +++ b/OwnedEntityWithUniqueIndex/OwnedEntityWithUniqueIndex.csproj @@ -9,6 +9,7 @@ + diff --git a/OwnedEntityWithUniqueIndex/Program.cs b/OwnedEntityWithUniqueIndex/Program.cs index 1b8710e..f1b759d 100644 --- a/OwnedEntityWithUniqueIndex/Program.cs +++ b/OwnedEntityWithUniqueIndex/Program.cs @@ -23,5 +23,5 @@ context.Entry(child).Reference(e => e.Owned).TargetEntry!.Property(nameof(Child.ParentId)) .CurrentValue = child.ParentId; - context.SaveChanges(); + context.BulkInsert(new[] { child }); }