OWIN DbContext and a single DbContext for all of my Repositories
问题 I am building a ASP.NET MVC application. I'm new to the whole Repositories/Unit Of Work patterns. I'm part way through implementing a generic repository for my EF objects. I realise that there is an issue with ensuring that you only have a single DbContext per Http request... I'm pretty sure that I can achieve this by creating an instance using OWIN. /// <summary> /// Configures OWIN /// </summary> /// <param name="app"></param> public void Configuration(IAppBuilder app) { // Create instance