public IActionResult Blogs() { BlogsVM blogsVM = new BlogsVM { Blogs = _work.Blogs.GetAll() }; return(View(blogsVM)); }
public IActionResult BlogsCommentView() { ViewData["BlogId"] = new SelectList(_work.Blogs.GetAll(), "Id", "Id"); // ViewData["BlogId"] = new SelectList(_work.Products.GetAll(), "Id", "Id"); BlogsVM blogsDetailsvm = new BlogsVM(); return(PartialView("_CommentView", blogsDetailsvm)); }
public IActionResult Blogs() { BlogsVM blogsVM = new BlogsVM { Blogs = _work.Blogs.GetAll().OrderBy(x => x.Order).ToList(), singleblogs = _work.Blogs.GetWithSingleImage(), lastImage = _work.Blogs.GetWithLatImage(), }; return(View(blogsVM)); }
public IActionResult BlogsCommentCreateView(int id) { BlogsVM blogsDetailsvm = new BlogsVM { BlogsItem = _work.Blogs.Get(id), blogcomment = _work.BlogComment.GetAll(), commentCount = _work.BlogComment.GetWithAllComment() }; return(PartialView("_CommentView", blogsDetailsvm)); }
public IActionResult BlogsDetails(int id) { BlogsVM blogsDetailsvm = new BlogsVM { BlogsItem = _work.Blogs.Get(id), blogcomment = _work.BlogComment.GetAll(), commentCount = _work.BlogComment.GetWithAllComment() }; return(View(blogsDetailsvm)); }
public IActionResult BlogsDetails(int id) { var result = _context.BlogComments.ToList(); ViewBag.comment = result.Count(); BlogsVM blogsDetailsvm = new BlogsVM { BlogsItem = _work.Blogs.Get(id), blogcomment = _work.BlogComment.GetAll(), commentCount = _work.BlogComment.GetWithAllComment() }; return(View(blogsDetailsvm)); }
public IActionResult BlogsCommentCreate(BlogsVM blogsVM) { if (ModelState.IsValid) { BlogComment blogComment = new BlogComment { FullName = blogsVM.FullName, Email = blogsVM.Email, Comment = blogsVM.Comment, BlogId = blogsVM.BlogId, }; _work.BlogComment.Add(blogComment); _work.Complete(); ViewData["BlogId"] = new SelectList(_work.Blogs.GetAll(), "Id", "Id"); return(PartialView("_CommentView", blogsVM)); } return(PartialView("_CommentView", blogsVM)); }