public IActionResult Get(int id) { // Assume the user is not authorized IActionResult result = Unauthorized(); try { VisitItem visit = _db.GetVisit(id); VisitDTO dTO = MapToDTO(visit); result = Ok(dTO); } catch (Exception) { result = BadRequest(new { Message = "Get visit failed." }); } return(result); }