public async Task <IActionResult> GetAsync(int id) { var result = await _treatmentService.GetByIdAsync(id); if (!result.Success) { return(BadRequest(result.Message)); } var treatmentResource = _mapper.Map <Treatment, TreatmentResource>(result.Resource); return(Ok(treatmentResource)); }
public async Task <TreatmentDto> Get([FromQuery] int id) { var treatment = await _treatmentService.GetByIdAsync(id); return(treatment); }