Skip to content

Commit

Permalink
Fixed Dependency Injection. (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
Utar94 authored Dec 27, 2024
1 parent 28ea7e2 commit b9e998b
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 14 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

Nothing yet.
### Fixed

- Dependency Injection.

## [3.0.2] - 2024-12-27

Expand Down
2 changes: 1 addition & 1 deletion lib/Logitar.Identity.Core/Logitar.Identity.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.11.0" />
<PackageReference Include="libphonenumber-csharp" Version="8.13.52" />
<PackageReference Include="Logitar.EventSourcing" Version="7.0.0" />
<PackageReference Include="Logitar.EventSourcing" Version="7.0.1" />
<PackageReference Include="Logitar.Security" Version="7.0.1" />
<PackageReference Include="MediatR.Contracts" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public static IServiceCollection AddLogitarIdentityWithEntityFrameworkCorePostgr
return services
.AddDbContext<IdentityContext>(options => options.UseNpgsql(connectionString,
builder => builder.MigrationsAssembly("Logitar.Identity.EntityFrameworkCore.PostgreSQL")))
.AddLogitarEventSourcingWithEntityFrameworkCorePostgreSQL(connectionString)
.AddLogitarIdentityWithEntityFrameworkCoreRelational();
.AddLogitarEventSourcingWithEntityFrameworkCorePostgreSQL(connectionString);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Logitar.EventSourcing.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
<PackageReference Include="Logitar.EventSourcing.EntityFrameworkCore.PostgreSQL" Version="7.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Logitar.Identity.Core.Users;
using Logitar.Identity.EntityFrameworkCore.Relational.Repositories;
using Logitar.Identity.EntityFrameworkCore.Relational.Tokens;
using Logitar.Identity.Infrastructure;
using Microsoft.Extensions.DependencyInjection;

namespace Logitar.Identity.EntityFrameworkCore.Relational;
Expand All @@ -18,7 +17,6 @@ public static IServiceCollection AddLogitarIdentityWithEntityFrameworkCoreRelati
{
return services
.AddLogitarEventSourcingWithEntityFrameworkCoreRelational()
.AddLogitarIdentityInfrastructure()
.AddMediatR(config => config.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()))
.AddRepositories()
.AddTransient<ICustomAttributeService, CustomAttributeService>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Logitar.EventSourcing.EntityFrameworkCore.Relational" Version="7.0.0" />
<PackageReference Include="Logitar.EventSourcing.EntityFrameworkCore.Relational" Version="7.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public static IServiceCollection AddLogitarIdentityWithEntityFrameworkCoreSqlSer
return services
.AddDbContext<IdentityContext>(options => options.UseSqlServer(connectionString,
builder => builder.MigrationsAssembly("Logitar.Identity.EntityFrameworkCore.SqlServer")))
.AddLogitarEventSourcingWithEntityFrameworkCoreSqlServer(connectionString)
.AddLogitarIdentityWithEntityFrameworkCoreRelational();
.AddLogitarEventSourcingWithEntityFrameworkCoreSqlServer(connectionString);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Logitar.EventSourcing.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageReference Include="Logitar.EventSourcing.EntityFrameworkCore.SqlServer" Version="7.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Logitar.EventSourcing.Infrastructure;
using Logitar.Identity.Core;
using Logitar.Identity.Core.Passwords;
using Logitar.Identity.Core.Tokens;
using Logitar.Identity.Infrastructure.Converters;
Expand All @@ -16,7 +15,6 @@ public static class DependencyInjectionExtensions
public static IServiceCollection AddLogitarIdentityInfrastructure(this IServiceCollection services)
{
return services
.AddLogitarIdentityCore()
.AddPasswordStrategies()
.AddSingleton(serviceProvider =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Logitar.EventSourcing.Infrastructure" Version="7.0.0" />
<PackageReference Include="Logitar.EventSourcing.Infrastructure" Version="7.0.1" />
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="9.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.3.0" />
Expand Down
6 changes: 6 additions & 0 deletions tests/Logitar.Identity.IntegrationTests/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
using Logitar.Data.PostgreSQL;
using Logitar.Data.SqlServer;
using Logitar.EventSourcing.EntityFrameworkCore.Relational;
using Logitar.Identity.Core;
using Logitar.Identity.EntityFrameworkCore.PostgreSQL;
using Logitar.Identity.EntityFrameworkCore.Relational;
using Logitar.Identity.EntityFrameworkCore.SqlServer;
using Logitar.Identity.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -35,6 +37,10 @@ protected IntegrationTests(DatabaseProvider databaseProvider)
ServiceCollection services = new();
services.AddSingleton(Configuration);

services.AddLogitarIdentityCore();
services.AddLogitarIdentityInfrastructure();
services.AddLogitarIdentityWithEntityFrameworkCoreRelational();

string connectionString = Configuration.GetConnectionString(databaseProvider.ToString())
?.Replace("{Database}", GetType().Name)
?? throw new InvalidOperationException($"The connection string '{databaseProvider}' is required.");
Expand Down

0 comments on commit b9e998b

Please sign in to comment.