コード例 #1
0
        public IActionResult Detail(int id)
        {
            if (id <= 0)
            {
                return(RedirectToNotFoundPage());
            }

            try
            {
                var status = _userStatusService.Find(id);
                if (status == null)
                {
                    return(RedirectToNotFoundPage());
                }

                var model = new UserStatusModel()
                {
                    Id          = status.Id,
                    Name        = status.Name,
                    Description = status.Description
                };
                return(View(model));
            }
            catch (Exception)
            {
                return(RedirectToErrorPage());
            }
        }