Пример #1
0
 public ActionResult Create(PostNewModel e)
 {
     try
     {
         var post = new Posts()
         {
             Text   = e.Text,
             UserId = userService.getUserByName(User.Identity.Name).UserId
         };
         postService.Create(post);
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(RedirectToAction("Index", "Home"));
     }
 }