Пример #1
0
        public IActionResult AddPost(Post post)
        {
            postServer.Add(post);
            var user = userServer.FindById(post.UserId);

            return(Redirect($"/?username={user.UserName}"));
        }
Пример #2
0
 public IActionResult AddPost(Post post)
 {
     postServer.Add(post);
     return(RedirectToAction(nameof(Index)));
 }