Skip to content

Commit 708cfc8

Browse files
authored
Merge pull request #16 from InvisibleSafe/configure-dependency-injection
Configure dependency injection
2 parents 6a3205e + a812b8a commit 708cfc8

File tree

8 files changed

+72
-0
lines changed

8 files changed

+72
-0
lines changed

backend/src/AuthService/AuthService.Api/AuthService.Api.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@
1111
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
1212
</ItemGroup>
1313

14+
<ItemGroup>
15+
<ProjectReference Include="..\AuthService.Application\AuthService.Application.csproj" />
16+
<ProjectReference Include="..\AuthService.Infrastructure\AuthService.Infrastructure.csproj" />
17+
<ProjectReference Include="..\AuthService.Persistence\AuthService.Persistence.csproj" />
18+
</ItemGroup>
19+
1420
</Project>

backend/src/AuthService/AuthService.Api/Program.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
using AuthService.Application;
2+
using AuthService.Infrastructure;
3+
using AuthService.Persistence;
4+
15
var builder = WebApplication.CreateBuilder(args);
26
builder.WebHost.UseUrls("http://0.0.0.0:8082");
37

8+
builder.Services
9+
.AddPersistenceServices(builder.Configuration)
10+
.AddInfrastructureServices()
11+
.AddApplicationServices();
12+
413
var app = builder.Build();
514

615
app.UseHttpsRedirection();

backend/src/AuthService/AuthService.Application/AuthService.Application.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,14 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<ProjectReference Include="..\AuthService.Domain\AuthService.Domain.csproj" />
11+
<ProjectReference Include="..\AuthService.Infrastructure\AuthService.Infrastructure.csproj" />
12+
<ProjectReference Include="..\AuthService.Persistence\AuthService.Persistence.csproj" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
17+
</ItemGroup>
18+
919
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
3+
namespace AuthService.Application;
4+
5+
public static class DependencyInjection
6+
{
7+
public static IServiceCollection AddApplicationServices(this IServiceCollection services)
8+
{
9+
return services;
10+
}
11+
}

backend/src/AuthService/AuthService.Infrastructure/AuthService.Infrastructure.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
11+
</ItemGroup>
12+
913
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
3+
namespace AuthService.Infrastructure;
4+
5+
public static class DependencyInjection
6+
{
7+
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services)
8+
{
9+
return services;
10+
}
11+
}

backend/src/AuthService/AuthService.Persistence/AuthService.Persistence.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,13 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<ProjectReference Include="..\AuthService.Domain\AuthService.Domain.csproj" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
15+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
16+
</ItemGroup>
17+
918
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.Extensions.Configuration;
2+
using Microsoft.Extensions.DependencyInjection;
3+
4+
namespace AuthService.Persistence;
5+
6+
public static class DependencyInjection
7+
{
8+
public static IServiceCollection AddPersistenceServices(this IServiceCollection services, IConfiguration configuration)
9+
{
10+
return services;
11+
}
12+
}

0 commit comments

Comments
 (0)