public PartialViewResult AddComment(int PostId, string UserName, string Email, string CommentText) { int?userId = null; if (string.IsNullOrEmpty(User.Identity.Name)) { UserDAO.GetUserId(User.Identity.Name); } CommentDAO.AddComments(PostId, userId, UserName, Email, CommentText); IEnumerable <ViewCommentsModel> viewComments = new List <ViewCommentsModel>(); viewComments = ViewCommentsModel.GetListComments(CommentDAO.GetComments(PostId)); return(PartialView("_Comments", viewComments)); }