48 lines
1.9 KiB
C#
48 lines
1.9 KiB
C#
namespace LaaProduction.Web
|
|
{
|
|
using LaaProduction.Personalization;
|
|
using LaaProduction.Search;
|
|
using LaaProduction.Services;
|
|
using LaaProduction.Services.Interfaces;
|
|
using LaaProduction.Web.App_Infrastructure;
|
|
using LaaProductionDI;
|
|
using LaaProductionHttp;
|
|
using LaaProductionSQL;
|
|
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
using System.Web.Mvc;
|
|
using System.Web.Optimization;
|
|
using System.Web.Routing;
|
|
|
|
public class WebApiApplication : HttpApplication
|
|
{
|
|
protected void Application_Start()
|
|
{
|
|
LaaServiceProvider.Configure(ConfigureServices);
|
|
LaaServiceProvider.BuildServiceProvider();
|
|
AreaRegistration.RegisterAllAreas();
|
|
GlobalConfiguration.Configure(WebApiConfig.Register);
|
|
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
|
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
|
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
|
}
|
|
|
|
private void ConfigureServices(LaaServiceCollection services)
|
|
=> services
|
|
.AddSingleton(SQLConnection.CreateSQLConnection(Appsettings.ConnectionString))
|
|
.AddSingleton(HttpClient.CreateHttpClient(Appsettings.APIURL, Appsettings.APIPrefix))
|
|
.AddScoped<IAccountService, AccountService>()
|
|
.AddScoped<IApprovalsService, ApprovalsService>()
|
|
.AddScoped<ILoggerService, LoggerService>()
|
|
.AddScoped<IOrdersService, OrdersService>()
|
|
.AddScoped<IProtocolService, ProtocolService>()
|
|
.AddScoped<IReportService, ReportService>()
|
|
.AddScoped<ISearchService, SearchService>()
|
|
.AddScoped<IShipmentsService, ShipmentsService>()
|
|
.AddScoped<ISoftwareService, SoftwareService>()
|
|
.AddAdministration()
|
|
.AddSearching();
|
|
}
|
|
}
|