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
907 B
24 lines
907 B
using System.Threading; |
|
using System.Threading.Tasks; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
using LanguageExt; |
|
using MediatR; |
|
using static ErsatzTV.Application.ProgramSchedules.Mapper; |
|
|
|
namespace ErsatzTV.Application.ProgramSchedules.Queries |
|
{ |
|
public class |
|
GetProgramScheduleByIdHandler : IRequestHandler<GetProgramScheduleById, Option<ProgramScheduleViewModel>> |
|
{ |
|
private readonly IProgramScheduleRepository _programScheduleRepository; |
|
|
|
public GetProgramScheduleByIdHandler(IProgramScheduleRepository programScheduleRepository) => |
|
_programScheduleRepository = programScheduleRepository; |
|
|
|
public Task<Option<ProgramScheduleViewModel>> Handle( |
|
GetProgramScheduleById request, |
|
CancellationToken cancellationToken) => |
|
_programScheduleRepository.Get(request.Id) |
|
.MapT(ProjectToViewModel); |
|
} |
|
}
|
|
|