I'm working on ASP.NET MVC 4.5 site using EF. I have code that checks if a record in the DB exists, and if it doesn't it creates a new record. As a result of a problem in my code which I've subsequently fixed I was calling this code twice within a fraction of a second. The result was that a duplicate record was created. Here is my code:I'm working on ASP.NET MVC 4.5 site using EF. I