public IActionResult CreateComment(string Comment, string Name, string Surname, string Email, string WebSite, int blogId) { var userId = HttpContext.Session.GetString("ActiveCustomerId"); var entity = new FarmerComment() { BlogId = blogId, Comment = Comment, Name = Name, Surname = Surname, Email = Email, UserId = Convert.ToInt32(userId), WebSite = WebSite, CommentDate = DateTime.Now.ToShortDateString() }; _blogService.CreateComment(entity); return(Redirect("/Home/GetBlogArticleDetails/" + blogId)); }
public void CreateComment(FarmerComment entity) => _commentRepository.Create(entity);