mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
787 B
24 lines
787 B
using System.Threading; |
|
using System.Threading.Tasks; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
using LanguageExt; |
|
using MediatR; |
|
using static ErsatzTV.Application.Playouts.Mapper; |
|
|
|
namespace ErsatzTV.Application.Playouts.Queries |
|
{ |
|
public class |
|
GetPlayoutByIdHandler : IRequestHandler<GetPlayoutById, Option<PlayoutViewModel>> |
|
{ |
|
private readonly IPlayoutRepository _playoutRepository; |
|
|
|
public GetPlayoutByIdHandler(IPlayoutRepository playoutRepository) => |
|
_playoutRepository = playoutRepository; |
|
|
|
public Task<Option<PlayoutViewModel>> Handle( |
|
GetPlayoutById request, |
|
CancellationToken cancellationToken) => |
|
_playoutRepository.Get(request.Id) |
|
.MapT(ProjectToViewModel); |
|
} |
|
}
|
|
|