diff --git a/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj b/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj index fb5cc40..df513f9 100644 --- a/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj +++ b/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj @@ -1,7 +1,7 @@  - net8.0; net7.0; net6.0 + net8.0; net7.0 enable enable diff --git a/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj b/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj index 18760ab..88633ac 100644 --- a/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj +++ b/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj @@ -1,7 +1,7 @@  - net8.0; net7.0; net6.0 + net8.0; net7.0 enable enable diff --git a/src/Fluss.PostgreSQL/ServiceCollectionExtensions.cs b/src/Fluss.PostgreSQL/ServiceCollectionExtensions.cs index 81364c4..cf499c7 100644 --- a/src/Fluss.PostgreSQL/ServiceCollectionExtensions.cs +++ b/src/Fluss.PostgreSQL/ServiceCollectionExtensions.cs @@ -27,7 +27,7 @@ public static IServiceCollection AddPostgresEventSourcingRepository(this IServic } return services - .AddScoped() + .AddBaseEventRepository() .AddFluentMigratorCore() .ConfigureRunner(rb => rb .AddPostgres() diff --git a/src/Fluss.Testing/Fluss.Testing.csproj b/src/Fluss.Testing/Fluss.Testing.csproj index 69647b0..d3eab38 100644 --- a/src/Fluss.Testing/Fluss.Testing.csproj +++ b/src/Fluss.Testing/Fluss.Testing.csproj @@ -1,7 +1,7 @@  - net8.0; net7.0; net6.0 + net8.0; net7.0 enable enable diff --git a/src/Fluss.UnitTest/Fluss.UnitTest.csproj b/src/Fluss.UnitTest/Fluss.UnitTest.csproj index 12e7d85..0e81098 100644 --- a/src/Fluss.UnitTest/Fluss.UnitTest.csproj +++ b/src/Fluss.UnitTest/Fluss.UnitTest.csproj @@ -1,7 +1,7 @@ - net8.0; net7.0; net6.0 + net8.0; net7.0 enable enable diff --git a/src/Fluss/Authentication/ServiceCollectionExtensions.cs b/src/Fluss/Authentication/ServiceCollectionExtensions.cs index 05f2360..32dd6ad 100644 --- a/src/Fluss/Authentication/ServiceCollectionExtensions.cs +++ b/src/Fluss/Authentication/ServiceCollectionExtensions.cs @@ -11,9 +11,9 @@ public static IServiceCollection AddPoliciesFrom(this IServiceCollection service foreach (var policyType in policyTypes) { - services = services - .AddScoped(policyType) - .AddScoped(sp => (Policy)sp.GetRequiredService(policyType)); + services + .AddSingleton(policyType) + .AddSingleton(sp => (Policy)sp.GetRequiredService(policyType)); } return services; diff --git a/src/Fluss/Fluss.csproj b/src/Fluss/Fluss.csproj index 9a0b67f..09d03d5 100644 --- a/src/Fluss/Fluss.csproj +++ b/src/Fluss/Fluss.csproj @@ -1,7 +1,7 @@  - net8.0; net7.0; net6.0 + net8.0; net7.0 enable enable Fluss diff --git a/src/Fluss/ServiceCollectionExtensions.cs b/src/Fluss/ServiceCollectionExtensions.cs index 9f318b6..54a38be 100644 --- a/src/Fluss/ServiceCollectionExtensions.cs +++ b/src/Fluss/ServiceCollectionExtensions.cs @@ -91,7 +91,7 @@ public static IServiceCollection AddUpcasters(this IServiceCollection services, foreach (var upcaster in upcasters) { - services.AddScoped(upcasterType, upcaster); + services.AddSingleton(upcasterType, upcaster); } return services.AddSingleton().AddSingleton(); diff --git a/src/Fluss/SideEffects/SideEffectsServiceCollectionExtension.cs b/src/Fluss/SideEffects/SideEffectsServiceCollectionExtension.cs index 40906a2..f1617ec 100644 --- a/src/Fluss/SideEffects/SideEffectsServiceCollectionExtension.cs +++ b/src/Fluss/SideEffects/SideEffectsServiceCollectionExtension.cs @@ -11,7 +11,7 @@ public static IServiceCollection RegisterSideEffects(this IServiceCollection ser foreach (var @class in implementingClasses) { - services.AddScoped(typeof(SideEffect), @class); + services.AddSingleton(typeof(SideEffect), @class); } services.AddHostedService(); diff --git a/src/Fluss/Validation/ValidationServiceCollectionExtension.cs b/src/Fluss/Validation/ValidationServiceCollectionExtension.cs index 0dfced7..c7ba6ce 100644 --- a/src/Fluss/Validation/ValidationServiceCollectionExtension.cs +++ b/src/Fluss/Validation/ValidationServiceCollectionExtension.cs @@ -12,7 +12,7 @@ public static IServiceCollection AddValidationFrom(this IServiceCollection servi sourceAssembly.GetTypes().Where(t => t.IsAssignableTo(aggregateValidatorType)).ToList(); foreach (var aggregateValidator in aggregateValidators) { - services.AddScoped(aggregateValidatorType, aggregateValidator); + services.AddSingleton(aggregateValidatorType, aggregateValidator); } var eventValidatorType = typeof(EventValidator); @@ -20,7 +20,7 @@ public static IServiceCollection AddValidationFrom(this IServiceCollection servi sourceAssembly.GetTypes().Where(t => t.IsAssignableTo(eventValidatorType)).ToList(); foreach (var eventValidator in eventValidators) { - services.AddScoped(eventValidatorType, eventValidator); + services.AddSingleton(eventValidatorType, eventValidator); } services.AddSingleton();