Exemplo n.º 1
0
 public ActionResult Details(Guid id)
 {
     IRepository<Post> repo = new PostRepository();
     Post post = repo.GetById(id);
     PostViewModel model = new PostViewModel(post);
     return View(model);
 }
Exemplo n.º 2
0
 public ActionResult Create()
 {
     
     IRepository<Category> repo = new CategoryRepository();
     PostViewModel model = new PostViewModel(repo.GetAll());
     return View(model);
 }
Exemplo n.º 3
0
        public ActionResult Edit(Guid id)
        {
            IRepository<Post> postsRepo = new PostRepository();
            IRepository<Category> categoriesRepo = new CategoryRepository();

            PostViewModel model = new PostViewModel(postsRepo.GetById(id), categoriesRepo.GetAll());

            return View(model);
        }