0
chrskrs created
Prerequisites
- What is your product version? 8.3
- What is your product type (Angular or MVC)? MVC
- What is product framework type (.net framework or .net core)? .NET Core
If issue related with ABP Framework
- What is ABP Framework version? 8.3
I am trying to intergare the EasyQuery reporting product into my Net Zero application but I have the following problem / question:
In Startup.cs class Easy query requires that the DB context be given in the Configure function like this:
endpoints.MapEasyQuery(options => { options.UseDbContext<MyDbContext>(services => new MyDbContext(...) }
How can Ido the new part seeing that aspnet zero uses IDbcontextProvider to get the dbcontext?
1 Answer(s)
-
0
Hi,
You can solve this problem like this;
Add the code block below into Initialize Method of *WebHostModule.cs class;
Configuration.IocManager.IocContainer.Register(Component .For(typeof(DbContextOptions<EqTestProjectDbContext>)).UsingFactoryMethod((kernel, context) => { var builder = new DbContextOptionsBuilder<EqTestProjectDbContext>(); builder.UseSqlServer(Configuration.DefaultNameOrConnectionString); return builder.Options; }));