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.
23 lines
927 B
23 lines
927 B
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Threading; |
|
using System.Threading.Tasks; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
using MediatR; |
|
using static ErsatzTV.Application.ProgramSchedules.Mapper; |
|
|
|
namespace ErsatzTV.Application.ProgramSchedules.Queries |
|
{ |
|
public class GetAllProgramSchedulesHandler : IRequestHandler<GetAllProgramSchedules, List<ProgramScheduleViewModel>> |
|
{ |
|
private readonly IProgramScheduleRepository _programScheduleRepository; |
|
|
|
public GetAllProgramSchedulesHandler(IProgramScheduleRepository programScheduleRepository) => |
|
_programScheduleRepository = programScheduleRepository; |
|
|
|
public async Task<List<ProgramScheduleViewModel>> Handle( |
|
GetAllProgramSchedules request, |
|
CancellationToken cancellationToken) => |
|
(await _programScheduleRepository.GetAll()).Map(ProjectToViewModel).ToList(); |
|
} |
|
}
|
|
|