2023-02-09 10:25:42 +01:00
|
|
|
|
using Application.Common.Models;
|
|
|
|
|
using Application.Interfaces;
|
2023-02-12 19:12:26 +01:00
|
|
|
|
using Domain.Config;
|
2023-02-09 10:25:42 +01:00
|
|
|
|
|
|
|
|
|
namespace Application.Game.Card;
|
|
|
|
|
|
|
|
|
|
public abstract class CardRequestHandlerBase<TIn, TOut>: IRequestHandlerWrapper<TIn, TOut>
|
|
|
|
|
where TIn : IRequestWrapper<TOut>
|
|
|
|
|
{
|
2023-02-12 19:12:26 +01:00
|
|
|
|
protected ICardDbContext CardDbContext { get; }
|
|
|
|
|
protected IMusicDbContext MusicDbContext { get; }
|
|
|
|
|
|
|
|
|
|
protected GameConfig Config { get; }
|
2023-02-09 10:25:42 +01:00
|
|
|
|
|
|
|
|
|
public CardRequestHandlerBase(ICardDependencyAggregate aggregate)
|
|
|
|
|
{
|
|
|
|
|
CardDbContext = aggregate.CardDbContext;
|
|
|
|
|
MusicDbContext = aggregate.MusicDbContext;
|
2023-02-12 19:12:26 +01:00
|
|
|
|
Config = aggregate.Options.Value;
|
2023-02-09 10:25:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract Task<ServiceResult<TOut>> Handle(TIn request, CancellationToken cancellationToken);
|
|
|
|
|
}
|