mirror of
https://github.com/bitwarden/server
synced 2026-01-03 17:14:00 +00:00
Refactor to CQRS
This commit is contained in:
@@ -1,11 +1,32 @@
|
||||
using System.Reflection;
|
||||
using Bit.Seeder;
|
||||
using Bit.SeederApi.Commands;
|
||||
using Bit.SeederApi.Commands.Interfaces;
|
||||
using Bit.SeederApi.Execution;
|
||||
using Bit.SeederApi.Queries;
|
||||
using Bit.SeederApi.Queries.Interfaces;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
namespace Bit.SeederApi.Extensions;
|
||||
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers SeederApi executors, commands, and queries.
|
||||
/// </summary>
|
||||
public static IServiceCollection AddSeederApiServices(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<ISceneExecutor, SceneExecutor>();
|
||||
services.AddScoped<IQueryExecutor, QueryExecutor>();
|
||||
|
||||
services.AddScoped<IDestroySceneCommand, DestroySceneCommand>();
|
||||
services.AddScoped<IDestroyBatchScenesCommand, DestroyBatchScenesCommand>();
|
||||
|
||||
services.AddScoped<IGetAllPlayIdsQuery, GetAllPlayIdsQuery>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dynamically registers all scene types that implement IScene<TRequest> from the Seeder assembly.
|
||||
/// Scenes are registered as keyed scoped services using their class name as the key.
|
||||
|
||||
Reference in New Issue
Block a user