public async Task <IEnumerable <ReasonCodeDto> > HandleAsync(FindReasonCode query) { _registry.IncrementFindDiscountsQuery(); var codes = await _reasonCodeRepository.FindAsync( c => c.AppointmentId == query.AppointmentIdId); return(codes.Select(rc => new ReasonCodeDto { Code = rc.Code, Description = rc.Description })); }
public async Task <ActionResult <IEnumerable <ReasonCodeDto> > > Get([FromQuery] FindReasonCode query) => Ok(await _dispatcher.QueryAsync(query));