Example #1
0
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var persons = await _pers.GetDetails((int)id);

            if (persons == null)
            {
                return(BadRequest());
            }

            if (persons.User != HttpContext.User.Identity.Name || persons.User == "Default")
            {
                return(RedirectToAction(nameof(Index)));
            }

            return(View(persons));
        }