public ActionResult AcceptComment(string commentId, string location) { var thisComm = databaseEntities.Comments.Find(Int32.Parse(commentId)); CommentViewModel comment = new CommentViewModel(thisComm, true, location); comment.acceptCommentFrom(thisComm); databaseEntities.SaveChanges(); switch (location) { case "Profile": return(RedirectToAction("ShowMyProfile", "Profile")); case "Newsfeed": return(RedirectToAction("Index", "NewsFeed")); case "Groups": return(RedirectToAction("Show", "Groups")); default: return(Index()); } }