public async Task <ActionResult <AllDoctorsReadModel> > GetAll() { var query = new GetAllDoctorsQuery(); var allDoctorsReadModel = await _getAllDoctorsQueryHandler.HandleAsync(query); return(Ok(allDoctorsReadModel)); }
public async Task <IReadOnlyList <AllDoctorsReadModel> > HandleAsync(GetAllDoctorsQuery query, CancellationToken cancellationToken = default) { var doctors = await _readModelData.GetDoctorTablesAsync(cancellationToken); return(doctors.Select(x => new AllDoctorsReadModel { DoctorId = x.DoctorId, Name = x.Name }).ToList()); }