示例#1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            var result = await pcc.SubmitPostAsync(PostDTO);

            if (result == null)
            {
                return(RedirectToAction("Error"));
            }
            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            PostDTO post = new PostDTO();

            post.Domain      = PostDTO.Domain;
            post.Description = PostDTO.Description;
            post.Date        = PostDTO.Date;
            var result = await pcc.SubmitPostAsync(post);

            if (result == null)
            {
                return(RedirectToAction("Error"));
            }
            return(RedirectToPage("./Index"));
        }