How-to inject the Entity Framework DbContext into the ConfigurationBasedRepository of SharpRepository
问题 I really would like to use SharpRepository together with Ninject, but I do not understand how to configure Ninject to share the Entity Framework DbContext between the repositories. I am using Entity Framework version 5 and Ninject version 3. Currently I am using Ef5Repository in my source code, but I want to replace it with ConfigurationBasedRepository . But I cannot figure out how to pass (or inject) the EF DbContext to the repositories. Example (current state): using SharpRepository