1
0
mirror of synced 2025-02-14 17:53:07 +01:00

21 lines
672 B
C#
Raw Normal View History

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