@ -1,20 +1,16 @@
using System ;
using System.IO ;
using System.IO ;
using Autofac ;
using Autofac.Extensions.DependencyInjection ;
using Microsoft.AspNetCore.Builder ;
using Microsoft.AspNetCore.Builder ;
using Microsoft.AspNetCore.Hosting ;
using Microsoft.AspNetCore.Hosting ;
using Microsoft.Extensions.DependencyInjection ;
using Microsoft.Extensions.DependencyInjection ;
using Microsoft.Extensions.Logging ;
using Microsoft.Extensions.Logging ;
using Serilog ;
using Serilog ;
using Volo.Abp ;
using Volo.Abp.Modularity.PlugIns ;
using Volo.Abp.Modularity.PlugIns ;
namespace AbpDesk.Web.Mvc
namespace AbpDesk.Web.Mvc
{
{
public class Startup
public class Startup
{
{
public IContainer ApplicationContainer { get ; private set ; }
private readonly IHostingEnvironment _env ;
private readonly IHostingEnvironment _env ;
public Startup ( IHostingEnvironment env )
public Startup ( IHostingEnvironment env )
@ -22,10 +18,12 @@ namespace AbpDesk.Web.Mvc
_env = env ;
_env = env ;
}
}
public IServiceProvider ConfigureServices ( IServiceCollection services )
public void ConfigureServices ( IServiceCollection services )
{
{
services . AddApplication < AbpDeskWebMvcModule > ( options = >
services . AddApplication < AbpDeskWebMvcModule > ( options = >
{
{
options . UseAutofac ( ) ;
/ * @halil : I added Abp . MongoDb package as a dependency to the main application in order to use the blog plugin .
/ * @halil : I added Abp . MongoDb package as a dependency to the main application in order to use the blog plugin .
* Otherwise , we should add all dependencies ( Recursively ) into plugin folder
* Otherwise , we should add all dependencies ( Recursively ) into plugin folder
* and load in correct order . We should carefully think on that problem in the future .
* and load in correct order . We should carefully think on that problem in the future .
@ -36,11 +34,6 @@ namespace AbpDesk.Web.Mvc
@"../Web_PlugIns/" )
@"../Web_PlugIns/" )
) ;
) ;
} ) ;
} ) ;
var builder = new ContainerBuilder ( ) ;
builder . Populate ( services ) ;
ApplicationContainer = builder . Build ( ) ;
return new AutofacServiceProvider ( ApplicationContainer ) ;
}
}
public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory , IApplicationLifetime appLifetime )
public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory , IApplicationLifetime appLifetime )
@ -54,8 +47,6 @@ namespace AbpDesk.Web.Mvc
. CreateLogger ( )
. CreateLogger ( )
) ;
) ;
appLifetime . ApplicationStopped . Register ( ( ) = > ApplicationContainer . Dispose ( ) ) ;
app . InitializeApplication ( ) ;
app . InitializeApplication ( ) ;
}
}
}
}