1
0
mirror of synced 2024-12-24 20:04:53 +01:00
GC-local-server-rewrite/Application/Common/Base/RequestHandlerBase.cs
2023-02-17 00:38:01 +08:00

21 lines
672 B
C#

using Domain.Config;
namespace Application.Common.Base;
public abstract class RequestHandlerBase<TIn, TOut>: IRequestHandlerWrapper<TIn, TOut>
where TIn : IRequestWrapper<TOut>
{
protected ICardDbContext CardDbContext { get; }
protected IMusicDbContext MusicDbContext { get; }
protected GameConfig Config { get; }
public RequestHandlerBase(ICardDependencyAggregate aggregate)
{
CardDbContext = aggregate.CardDbContext;
MusicDbContext = aggregate.MusicDbContext;
Config = aggregate.Options.Value;
}
public abstract Task<ServiceResult<TOut>> Handle(TIn request, CancellationToken cancellationToken);
}