public ActionResult Like(int id, IUpdateSetupService serviceSetup, IUpdateService serviceUpdate) { var dto = serviceSetup.GetOriginal <DetailPostDto>(id).Result; if (!ModelState.IsValid) { //model errors so return immediately return(View(serviceUpdate.ResetDto(dto))); } // increase the number of likes dto.Likes++; var response = serviceUpdate.Update(dto); if (response.IsValid) { TempData["message"] = response.SuccessMessage; return(RedirectToAction("Index")); } //else errors, so copy the errors over to the ModelState and return to view response.CopyErrorsToModelState(ModelState, dto); return(View(dto)); }
public ActionResult Edit(int id, IUpdateSetupService service) { return(View(service.GetOriginal <CrudCustomerDto>(id).Result)); }
public ActionResult EditAddress(int customerId, int addressId, IUpdateSetupService service) { return(View(service.GetOriginal <CrudCustomerAddressDto>(customerId, addressId).Result)); }
public ActionResult Edit(int id, IUpdateSetupService service) { return(View(service.GetOriginal <DetailPostDto>(id).Result)); }
public ActionResult Edit(int id, IUpdateSetupService service) { return View(service.GetOriginal<Blog>(id).Result); }
public ActionResult Edit(int id, IUpdateSetupService service) { return View(service.GetOriginal<CrudSalesOrderDto>(id).Result); }
public ActionResult EditAddress(int customerId, int addressId, IUpdateSetupService service) { return View(service.GetOriginal<CrudCustomerAddressDto>(customerId, addressId).Result); }