Entity Framework 5 Thread Agility
问题 A NullReferenceException deep inside EntityFramework code is thrown (EF bug?), but my question is about Entity Framework (v5) and WebAPI asynchronous controller action. A repro would be hard to recreate here, but the code in essence does the following: public class AController : ApiController { private IUow _uow; //among other things, a DbContext // DI ctor public AController(IUow uow) { _uow = uow; } [HttpPost] public async Task<HttpResponseMessage> Post(Model model) { Entity e = _uow.Entity