One DbContext per web request… why?

后端 未结 9 1255
死守一世寂寞
死守一世寂寞 2020-11-21 22:09

I have been reading a lot of articles explaining how to set up Entity Framework\'s DbContext so that only one is created and used per HTTP web request using var

9条回答
  •  猫巷女王i
    2020-11-21 22:52

    I'm pretty certain it is because the DbContext is not at all thread safe. So sharing the thing is never a good idea.

提交回复
热议问题