阅读背景:

当DB中有数据时,为什么“SingleOrDefault”在第二次执行时返回null?

来源:互联网 

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




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: