public ActionResult ManageAddTags(int postId, int tagId) { int userProfileId = GetCurrentUserProfileId(); var post = _postRepository.GetUserPostById(postId, userProfileId); var tagOptions = _postTagRepository.GetTagsWORelationshipByPostId(post.Id); var vm = new PostTagViewModel() { Post = post, TagOptions = tagOptions }; try { _postTagRepository.AddTagRelationship(postId, tagId); return(RedirectToAction("Details", "Post", new { @id = postId })); } catch (Exception ex) { return(View(vm)); } }