public async Task <IActionResult> DeleteZone([FromRoute] Zone zone) { try { return(Ok(await _context.DeleteZoneAsync(zone))); } catch (ArgumentException e) { return(BadRequest(new { error = e.Message })); } }
public async Task <StatusCodeResult> Delete(string id) { if (string.IsNullOrWhiteSpace(id)) { return(BadRequest()); } var result = await _zoneService.DeleteZoneAsync(id); if (!result) { return(NotFound()); } return(Ok()); }