public async Task <IActionResult> Delete(int id) { if (id < 1) { throw new BadArguementException($"Supplied ID is below starting value (Supplied: {id}, Required: id >= 1)."); } try { await _service.Delete(id); } catch (Exception e) { return(BadRequest(e)); } return(NoContent()); }
public ActionResult OnPostDelete(int modelId) { _weaponService.Delete(modelId); return(CustomRedirect(SitePages.MajorEditorWeaponsIndex)); }