public ActionResult ViewPost(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; return(View(data)); }
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)); }
public ActionResult Update(int id) { Post post = _postService.GetById(id); UpdatePostVM model = new UpdatePostVM(); model.PostDTO.Id = post.Id; model.PostDTO.Header = post.Header; model.PostDTO.Content = post.Content; model.PostDTO.ImagePath = post.ImagePath; model.Categories = _categoryService.GetActive(); model.AppUsers = _appUserService.GetActive(); return(View(model)); }
public ActionResult Update(int id) { Post post = _postRepository.GetById(id); UpdatePostVM model = new UpdatePostVM(); model.PostDTO.Id = post.Id; model.PostDTO.Header = post.Header; model.PostDTO.Content = post.Content; model.PostDTO.PublishDate = post.PublishDate; model.PostDTO.ImagePath = post.ImagePath; List <Category> categories = _categoryRepository.GetActive(); model.Categories = categories; List <AppUser> appUsers = _appUserRepository.GetActive(); model.AppUsers = appUsers; return(View(model)); }