I am guessing that the problem is that the execution of your LINQ query has been deferred until starting to access them on your view. At this point db
has already been disposed.
Try this:
return View(Users.ToList());
Added ToList()
That will force the fetch from the DB before disposing db
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…