public IActionResult Delete(PlatformTypeDeleteViewModel viewModel) { PlatformType platformType = platformTypeService.GetByID(viewModel.PlatformType.ID); if (platformType == null) { return(NotFound()); } platformTypeService.Delete(platformType.ID); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { if (id == 0) { return(NotFound()); } PlatformType platformType = platformTypeService.GetByID(id); if (platformType == null) { return(NotFound()); } PlatformTypeDeleteViewModel viewModel = new PlatformTypeDeleteViewModel { PlatformType = platformType }; return(View(viewModel)); }