sharp-repository

How-to inject the Entity Framework DbContext into the ConfigurationBasedRepository of SharpRepository

倾然丶 夕夏残阳落幕 提交于 2019-12-18 11:13:12
问题 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

How-to inject the Entity Framework DbContext into the ConfigurationBasedRepository of SharpRepository

浪尽此生 提交于 2019-12-18 11:13:11
问题 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

How-to inject the Entity Framework DbContext into the ConfigurationBasedRepository of SharpRepository

喜夏-厌秋 提交于 2019-11-30 01:50:22
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.Repository; public interface IProductRepository : IRepository<Product> { } using SharpRepository