Merge pull request #1 from TimetableDesigner/features/connection_string_handling

connection string handling added
This commit is contained in:
2026-01-18 20:42:06 +01:00
committed by GitHub
Unverified
2 changed files with 15 additions and 4 deletions

View File

@@ -4,11 +4,22 @@ namespace TimetableDesigner.Backend.Events.Extensions.AspNetCore.OpenApi;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddEventQueue<T>(this IServiceCollection services, Action<T> configuration) where T : EventQueue, new()
public static IServiceCollection AddEventQueue<TQueue, TBuilder>(this IServiceCollection services, Action<TBuilder> configuration)
where TQueue : EventQueue<TQueue>, new()
where TBuilder : EventQueueBuilder<TQueue>, new()
{
T builder = new T();
TBuilder builder = new TBuilder();
configuration(builder);
builder.Setup(services);
TQueue queue = new TQueue();
queue.Setup(services, builder);
return services;
}
public static IServiceCollection AddEventQueue<TQueue>(this IServiceCollection services, string connectionString)
where TQueue : EventQueue<TQueue>, new()
{
TQueue queue = new TQueue();
queue.Setup(services, connectionString);
return services;
}
}

View File

@@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.2" />
<PackageReference Include="timetabledesigner.backend.events" Version="1.1.1" />
<PackageReference Include="timetabledesigner.backend.events" Version="1.1.3" />
</ItemGroup>
<ItemGroup>