Exemplo n.º 1
0
        public async Task <IActionResult> Get([FromRoute] int id)
        {
            //try to find the dr by id, if not then 404 not found

            //if exists
            //  check if dr or one of the dr's patients for authorization.
            //  return unauthroirzed or the dr's data if authorized

            if (await _clinicRepository.GetDoctorByIDAsync(id) is Doctor doctor)
            {
                return(Ok(doctor));
            }
            else
            {
                return(NotFound());
            }
        }