public IActionResult Delete(PlatformDeleteViewModel viewModel) { Platform platform = platformService.GetByID(viewModel.Platform.ID); if (platform == null) { return(NotFound()); } platformService.Delete(platform.ID); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { if (id == 0) { return(NotFound()); } Platform platform = platformService.GetByID(id); if (platform == null) { return(NotFound()); } PlatformDeleteViewModel viewModel = new PlatformDeleteViewModel { Platform = platform, PlatformType = platformTypeService.GetByID((int)platform.PlatformTypeID) ?? null }; return(View(viewModel)); }