public ActionResult Update(int id) { Post post = _postRepo.GetById(id); UpdatePostVM data = new UpdatePostVM(); data.PostDTO.Id = post.id; data.PostDTO.Header = post.Header; data.PostDTO.Content = post.Content; data.PostDTO.ImagePath = post.ImagePath; data.Categories = _categoryRepo.GetActive(); data.AppUsers = _appUserRepo.GetDefault(x => x.Role != Role.Member); return(View(data)); }
// GET: Member/Post public ActionResult Show(int id) { PostDetailsVM data = new PostDetailsVM(); data.Post = _postRepo.GetById(id); data.AppUser = _appUserRepo.GetById(data.Post.AppUserId); data.Comments = _commentRepo.GetDefault(x => x.PostId == id && x.Status != Status.Passived); return(View()); }
// GET: Admin/Home public ActionResult HomePage(int id) { var getir = _postRepository.GetById(id); if (getir != null) { return(View("HomePage", getir)); } else { return(View("/Home/HomePage")); } }