public ActionResult Edit(CategoryViewModel viewModel) { if (ModelState.IsValid) { var dto = Mapper.Map<CategoryViewModel, CategoryDto>(viewModel); client.Update<CategoryDto>(UrlProvider.WebApiCategory, dto); return RedirectToAction("Index"); } return View(viewModel); }
public ActionResult Delete(CategoryViewModel viewModel) { client.Delete(UrlProvider.WebApiCategory + viewModel.Id); return RedirectToAction("Index"); }
public ActionResult Create() { var viewModel = new CategoryViewModel(); return View(viewModel); }