Lifestyle errors for DbContexts with multiple injections (ex. EntityRepository<TEntity> and FooService)
问题 I apologize for the lengthy post. Feel free to skip to Question at the bottom. The context is an ASP.NET system. Its data layer is based on Entity Framework, and dependency injection is facilitated by Simple Injector. There is currently only one DbContext and it is consumed by multiple classes in a command/query-like business services layer as well as basic repositories. Before // Context self mapped container.Register<SomeContext>(Lifestyle.Scoped); // Repositories were individually mapped,