コード例 #1
0
        public async Task <IActionResult> OnGetAsync(int id)
        {
            tempUser = await commentService.Get(id);

            if (tempUser == null)
            {
                return(RedirectToPage("/NotFound"));
            }

            return(Page());
        }
コード例 #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var tempCommentOutput = await commentService.Get(id.Value);

            commentOutputDto = mapper.Map <CommentsOutputDto>(tempCommentOutput);

            if (commentOutputDto == null)
            {
                return(NotFound());
            }
            return(Page());
        }