Update to Onion Architecture.
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
using skydiveLogs_api.DomainService.Repositories;
|
||||
using skydiveLogs_api.Infrastructure;
|
||||
using skydiveLogs_api.Business.Interfaces;
|
||||
using skydiveLogs_api.Business;
|
||||
using skydiveLogs_api.Infrastructure.Interfaces;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Ioc
|
||||
{
|
||||
@@ -17,26 +21,26 @@ namespace skydiveLogs_api.Ioc
|
||||
|
||||
public void Configure()
|
||||
{
|
||||
_services.AddScoped<Business.Interface.IAircraftService, Business.AircraftService>();
|
||||
_services.AddScoped<Business.Interface.IGearService, Business.GearService>();
|
||||
_services.AddScoped<Business.Interface.IDropZoneService, Business.DropZoneService>();
|
||||
_services.AddScoped<Business.Interface.IJumpService, Business.JumpService>();
|
||||
_services.AddScoped<Business.Interface.IJumpTypeService, Business.JumpTypeService>();
|
||||
_services.AddScoped<Business.Interface.IStatsService, Business.StatsService>();
|
||||
_services.AddScoped<Business.Interface.IUserService, Business.UserService>();
|
||||
_services.AddScoped<Business.Interface.IUserImageService, Business.UserImageService>();
|
||||
_services.AddScoped<Business.Interface.IInitDbService, Business.InitDbService>();
|
||||
_services.AddScoped<IAircraftService, AircraftService>();
|
||||
_services.AddScoped<IGearService, GearService>();
|
||||
_services.AddScoped<IDropZoneService, DropZoneService>();
|
||||
_services.AddScoped<IJumpService, JumpService>();
|
||||
_services.AddScoped<IJumpTypeService, JumpTypeService>();
|
||||
_services.AddScoped<IStatsService, StatsService>();
|
||||
_services.AddScoped<IUserService, UserService>();
|
||||
_services.AddScoped<IUserImageService, UserImageService>();
|
||||
_services.AddScoped<IInitDbService, InitDbService>();
|
||||
|
||||
_services.AddScoped<Data.Interface.IAircraftRepository, Data.AircraftRepository>();
|
||||
_services.AddScoped<Data.Interface.IDropZoneRepository, Data.DropZoneRepository>();
|
||||
_services.AddScoped<Data.Interface.IJumpRepository, Data.JumpRepository>();
|
||||
_services.AddScoped<Data.Interface.IJumpTypeRepository, Data.JumpTypeRepository>();
|
||||
_services.AddScoped<Data.Interface.IGearRepository, Data.GearRepository>();
|
||||
_services.AddScoped<Data.Interface.IUserRepository, Data.UserRepository>();
|
||||
_services.AddScoped<Data.Interface.IUserImageRepository, Data.UserImageRepository>();
|
||||
_services.AddScoped<IAircraftRepository, AircraftRepository>();
|
||||
_services.AddScoped<IDropZoneRepository, DropZoneRepository>();
|
||||
_services.AddScoped<IJumpRepository, JumpRepository>();
|
||||
_services.AddScoped<IJumpTypeRepository, JumpTypeRepository>();
|
||||
_services.AddScoped<IGearRepository, GearRepository>();
|
||||
_services.AddScoped<IUserRepository, UserRepository>();
|
||||
_services.AddScoped<IUserImageRepository, UserImageRepository>();
|
||||
|
||||
string connectionString = _configuration.GetConnectionString("DefaultConnection");
|
||||
_services.AddSingleton<Data.Interface.IDataProvider>(c => new Data.LiteDbProvider(connectionString));
|
||||
_services.AddSingleton<IDataProvider>(c => new LiteDbProvider(connectionString));
|
||||
}
|
||||
|
||||
private readonly IServiceCollection _services;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skydiveLogs-api.Business\skydiveLogs-api.Business.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Data\skydiveLogs-api.Data.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Data\skydiveLogs-api.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user