From 2aed60c75690fb925d552d77e9a055468cc1c812 Mon Sep 17 00:00:00 2001 From: Yaakov Ellis Date: Wed, 11 Jun 2014 10:31:58 +0300 Subject: [PATCH] avoid adding modelPersons with same Id in Sample project --- Sample.Mvc/Controllers/HomeController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sample.Mvc/Controllers/HomeController.cs b/Sample.Mvc/Controllers/HomeController.cs index 652ed67d8..46e60ec5b 100644 --- a/Sample.Mvc/Controllers/HomeController.cs +++ b/Sample.Mvc/Controllers/HomeController.cs @@ -256,7 +256,7 @@ public ActionResult EfModelFirst() using (MiniProfiler.Current.Step("Insertion")) { - var p = new ModelPerson { Name = "sam" }; + var p = new ModelPerson { Name = "sam", Id = new Random().Next(10000)}; context.ModelPersons.Add(p); context.SaveChanges(); }