public IActionResult Delete(int id) { try { if (ModelState.IsValid) { return(Ok(appSettingService.RemoveSetting(id))); } else { return(BadRequest(ModelState)); } } catch (Exception ex) { logger.LogError($"Failed to delete setting: {ex}", ex); } return(BadRequest("Failed to delete setting")); }