public ActionResult Manage(int id, PostTagViewModel vm) { try { var post = _postRepo.GetPostById(id); vm.Post = post; vm.TagList = _tagRepo.GetAll(); //list of all possible tags _postTagRepo.UpdateTags(vm); if (post.UserProfileId == GetCurrentUserProfileId()) { return(RedirectToAction("Details", "MyPosts", new { id = vm.Post.Id })); } else { return(RedirectToAction("Details", "Post", new { id = vm.Post.Id })); } } catch (Exception ex) { Console.WriteLine(ex); return(View(vm)); } }