Beispiel #1
0
        public IActionResult OnGet(int?visitid)
        {
            if (visitid == null)
            {
                return(RedirectToPage("/NotFound"));
            }

            Visit      = visitRepository.GetVisitById(visitid.Value);
            Visit.User = userManager.Users.SingleOrDefault();

            return(Page());
        }
        // GET: Visits/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Visit visit = _visitRepository.GetVisitById(id);

            if (visit == null)
            {
                return(HttpNotFound());
            }
            return(View(visit));
        }
Beispiel #3
0
        public async Task <VisitDto> GetVisitById(string id)
        {
            var visit = await _visitRepository.GetVisitById(id);

            var result = _mapper.Map <VisitDto>(visit);

            return(result);
        }