1
0
mirror of synced 2024-12-20 18:25:52 +01:00
GC-local-server-rewrite/Application/Common/Base/RequestHandlerBase.cs

21 lines
672 B
C#
Raw Normal View History

2023-02-16 09:53:02 +01:00
using Domain.Config;
2023-02-09 10:25:42 +01:00
2023-02-16 17:38:01 +01:00
namespace Application.Common.Base;
2023-02-09 10:25:42 +01:00
2023-02-16 17:38:01 +01:00
public abstract class RequestHandlerBase<TIn, TOut>: IRequestHandlerWrapper<TIn, TOut>
2023-02-09 10:25:42 +01:00
where TIn : IRequestWrapper<TOut>
{
protected ICardDbContext CardDbContext { get; }
protected IMusicDbContext MusicDbContext { get; }
protected GameConfig Config { get; }
2023-02-09 10:25:42 +01:00
2023-02-16 17:38:01 +01:00
public RequestHandlerBase(ICardDependencyAggregate aggregate)
2023-02-09 10:25:42 +01:00
{
CardDbContext = aggregate.CardDbContext;
MusicDbContext = aggregate.MusicDbContext;
Config = aggregate.Options.Value;
2023-02-09 10:25:42 +01:00
}
public abstract Task<ServiceResult<TOut>> Handle(TIn request, CancellationToken cancellationToken);
}