Add draft impl for Business stack and IoC
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -9,3 +9,8 @@
|
||||
/Back/skydiveLogs-api.Business/obj
|
||||
/Back/skydiveLogs-api.Data/obj
|
||||
/Back/skydiveLogs-api.Model/obj
|
||||
/Back/skydiveLogs-api.Model/bin
|
||||
/Back/skydiveLogs-api.Ioc/bin
|
||||
/Back/skydiveLogs-api.Ioc/obj
|
||||
/Back/skydiveLogs-api.Data/bin
|
||||
/Back/skydiveLogs-api.Business/bin
|
||||
|
||||
12
Back/skydiveLogs-api.Business/AircraftService.cs
Normal file
12
Back/skydiveLogs-api.Business/AircraftService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using skydiveLogs_api.Business.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace skydiveLogs_api.Business
|
||||
{
|
||||
public class AircraftService : IAircraftService
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
Back/skydiveLogs-api.Business/DropZoneService.cs
Normal file
11
Back/skydiveLogs-api.Business/DropZoneService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using skydiveLogs_api.Business.Interface;
|
||||
|
||||
namespace skydiveLogs_api.Business
|
||||
{
|
||||
public class DropZoneService : IDropZoneService
|
||||
{
|
||||
}
|
||||
}
|
||||
11
Back/skydiveLogs-api.Business/JumpService.cs
Normal file
11
Back/skydiveLogs-api.Business/JumpService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using skydiveLogs_api.Business.Interface;
|
||||
|
||||
namespace skydiveLogs_api.Business
|
||||
{
|
||||
public class JumpService : IJumpService
|
||||
{
|
||||
}
|
||||
}
|
||||
11
Back/skydiveLogs-api.Business/JumpTypeService.cs
Normal file
11
Back/skydiveLogs-api.Business/JumpTypeService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using skydiveLogs_api.Business.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace skydiveLogs_api.Business
|
||||
{
|
||||
public class JumpTypeService : IJumpTypeService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using System.Text;
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
interface IAircraftRepository
|
||||
public interface IAircraftRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
33
Back/skydiveLogs-api.Ioc/IocService.cs
Normal file
33
Back/skydiveLogs-api.Ioc/IocService.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace skydiveLogs_api.Ioc
|
||||
{
|
||||
public class IocService
|
||||
{
|
||||
public IocService(IServiceCollection services)
|
||||
{
|
||||
_services = services;
|
||||
}
|
||||
|
||||
public void Configure()
|
||||
{
|
||||
//services.AddSingleton<IConfigurationRoot>(Configuration);
|
||||
//_services.AddSingleton<Services.IGroupService, Services.GroupService>();
|
||||
//_services.AddSingleton<Services.IUserService, Services.UserService>();
|
||||
//_services.AddSingleton<Services.IPermissionService, Services.PermissionService>();
|
||||
|
||||
_services.AddScoped<Business.Interface.IAircraftService, Business.AircraftService>();
|
||||
_services.AddScoped<Business.Interface.IDropZoneService, Business.DropZoneService>();
|
||||
_services.AddScoped<Business.Interface.IJumpService, Business.JumpService>();
|
||||
_services.AddScoped<Business.Interface.IJumpTypeService, Business.JumpTypeService>();
|
||||
|
||||
_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>();
|
||||
}
|
||||
|
||||
private readonly IServiceCollection _services;
|
||||
}
|
||||
}
|
||||
19
Back/skydiveLogs-api.Ioc/skydiveLogs-api.Ioc.csproj
Normal file
19
Back/skydiveLogs-api.Ioc/skydiveLogs-api.Ioc.csproj
Normal file
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<RootNamespace>skydiveLogs_api.Ioc</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skydiveLogs-api.Business\skydiveLogs-api.Business.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Data\skydiveLogs-api.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions">
|
||||
<HintPath>..\..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.dependencyinjection.abstractions\2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -5,11 +5,13 @@ VisualStudioVersion = 15.0.28307.852
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "skydiveLogs-api", "skydiveLogs-api\skydiveLogs-api.csproj", "{0AC70CC2-CE52-4CD9-89D6-077800574360}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skydiveLogs-api.Model", "skydiveLogs-api.Model\skydiveLogs-api.Model.csproj", "{EF101C84-AE0D-4F5E-8BC5-0C55CB0B5D23}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "skydiveLogs-api.Model", "skydiveLogs-api.Model\skydiveLogs-api.Model.csproj", "{EF101C84-AE0D-4F5E-8BC5-0C55CB0B5D23}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skydiveLogs-api.Business", "skydiveLogs-api.Business\skydiveLogs-api.Business.csproj", "{803C3CFD-71D7-452F-848D-BF3DAF876CDF}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "skydiveLogs-api.Business", "skydiveLogs-api.Business\skydiveLogs-api.Business.csproj", "{803C3CFD-71D7-452F-848D-BF3DAF876CDF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skydiveLogs-api.Data", "skydiveLogs-api.Data\skydiveLogs-api.Data.csproj", "{887D2F69-A9E9-46C4-A5D9-3813A2387AA2}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "skydiveLogs-api.Data", "skydiveLogs-api.Data\skydiveLogs-api.Data.csproj", "{887D2F69-A9E9-46C4-A5D9-3813A2387AA2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skydiveLogs-api.Ioc", "skydiveLogs-api.Ioc\skydiveLogs-api.Ioc.csproj", "{D2ECA52D-DA50-47D4-8624-4487DE29E0C0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -33,6 +35,10 @@ Global
|
||||
{887D2F69-A9E9-46C4-A5D9-3813A2387AA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{887D2F69-A9E9-46C4-A5D9-3813A2387AA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{887D2F69-A9E9-46C4-A5D9-3813A2387AA2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D2ECA52D-DA50-47D4-8624-4487DE29E0C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D2ECA52D-DA50-47D4-8624-4487DE29E0C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D2ECA52D-DA50-47D4-8624-4487DE29E0C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D2ECA52D-DA50-47D4-8624-4487DE29E0C0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using skydiveLogs_api.Ioc;
|
||||
|
||||
namespace skydiveLogs_api
|
||||
{
|
||||
@@ -21,14 +22,8 @@ namespace skydiveLogs_api
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
|
||||
|
||||
// IoC
|
||||
//services.AddSingleton<IConfigurationRoot>(Configuration);
|
||||
//services.AddSingleton<Services.IGroupService, Services.GroupService>();
|
||||
//services.AddSingleton<Services.IUserService, Services.UserService>();
|
||||
//services.AddSingleton<Services.IPermissionService, Services.PermissionService>();
|
||||
|
||||
//services.AddScoped<Builder.IBuilderVmGroup, Builder.BuilderVmGroup>();
|
||||
//services.AddScoped<Builder.IBuilderVmUser, Builder.BuilderVmUser>();
|
||||
//services.AddScoped<Builder.IBuilderVmPermission, Builder.BuilderVmPermission>();
|
||||
var iocService = new IocService(services);
|
||||
iocService.Configure();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skydiveLogs-api.Business\skydiveLogs-api.Business.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Ioc\skydiveLogs-api.Ioc.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Model\skydiveLogs-api.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user