File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
src/AbpCompanyName.AbpProjectName.Web/Startup Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11using System . Reflection ;
22using Abp . AspNetCore ;
33using Abp . AspNetCore . Configuration ;
4- using Abp . EntityFrameworkCore . Configuration ;
54using Abp . Modules ;
65using AbpCompanyName . AbpProjectName . Configuration ;
76using AbpCompanyName . AbpProjectName . EntityFrameworkCore ;
@@ -27,11 +26,6 @@ public override void PreInitialize()
2726 {
2827 Configuration . DefaultNameOrConnectionString = _appConfiguration . GetConnectionString ( AbpProjectNameConsts . ConnectionStringName ) ;
2928
30- Configuration . Modules . AbpEfCore ( ) . AddDbContext < AbpProjectNameDbContext > ( options =>
31- {
32- DbContextOptionsConfigurer . Configure ( options . DbContextOptions , options . ConnectionString ) ;
33- } ) ;
34-
3529 Configuration . Navigation . Providers . Add < AbpProjectNameNavigationProvider > ( ) ;
3630
3731 Configuration . Modules . AbpAspNetCore ( )
Original file line number Diff line number Diff line change 11using System ;
22using Abp . AspNetCore ;
33using Abp . AspNetCore . Mvc ;
4+ using Abp . EntityFrameworkCore ;
5+ using AbpCompanyName . AbpProjectName . EntityFrameworkCore ;
46using Castle . Facilities . Logging ;
57using Microsoft . AspNetCore . Builder ;
68using Microsoft . AspNetCore . Hosting ;
@@ -13,6 +15,12 @@ public class Startup
1315 {
1416 public IServiceProvider ConfigureServices ( IServiceCollection services )
1517 {
18+ //Configure DbContext
19+ services . AddAbpDbContext < AbpProjectNameDbContext > ( options =>
20+ {
21+ DbContextOptionsConfigurer . Configure ( options . DbContextOptions , options . ConnectionString ) ;
22+ } ) ;
23+
1624 services . AddMvc ( options =>
1725 {
1826 options . AddAbp ( services ) ; //Add ABP infrastructure to MVC
You can’t perform that action at this time.
0 commit comments