Example #1
0
        public async Task <IActionResult> OnPostAsync(int userid)
        {
            try
            {
                posts.UserId = userid;

                posts.BoardId = await _boardsServices.CreateBoard(Board);

                postId = await _postsServices.CreatePost(posts);

                return(RedirectToPage("PostDetails", new { id = postId }));
            }
            catch (Exception)
            {
                return(RedirectToPage("../Error"));
            }
        }