public IActionResult ChangePrice(int id) //receive id and create a ChangePubDateDto and pass it to the View { var service = new ChangePriceService(_context); var dto = service.GetOriginal(id); return(View(dto)); }
public IActionResult ChangePrice(ChangePriceDto dto) //the ChangePubDateDto is received from the above method { var service = new ChangePriceService(_context); service.UpdateProduct(dto); return(View("ProductUpdated", "Successfully changed publication date")); }