阅读背景:

我应该如何在Web应用程序中对Entity Framework DbContext的依赖注入进行范围化? (InstancePerHttpRequest vs SingleInstance)

来源:互联网 

I have read that DbContext object should be created as InstancePerHttpRequest, not SingleInstance, because of its thread-unsafe nature and it might consume too much resource between requets which makes sence. But I am using Repository objects which uses DbContext instance. Should I make them InstancePerHttpRequest or make them SingleInstance and use DependencyResolver to get the current DbContext.I have read that DbContext object should be cre




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

分享到: