public IActionResult Delete(int id) { try { if (periodManager.Get(id) == null) { return(NotFound(id)); } periodManager.Delete(id); } catch (Exception ex) { logger.LogError($"Failed to delete period {id}: {ex}"); return(BadRequest(config["Error:Default"])); } return(NoContent()); }