Skip to content

Commit 2aed60c

Browse files
committed
avoid adding modelPersons with same Id in Sample project
1 parent a2b2cb2 commit 2aed60c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sample.Mvc/Controllers/HomeController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public ActionResult EfModelFirst()
256256

257257
using (MiniProfiler.Current.Step("Insertion"))
258258
{
259-
var p = new ModelPerson { Name = "sam" };
259+
var p = new ModelPerson { Name = "sam", Id = new Random().Next(10000)};
260260
context.ModelPersons.Add(p);
261261
context.SaveChanges();
262262
}

0 commit comments

Comments
 (0)