public async Task <ActionResult> ListAsync() { try { var result = await service.GetAllAsync(); if (result.Any()) { return(Ok(result)); } else { return(NoContent()); } } catch (Exception ex) { logger.LogError(ex.Message); return(StatusCode(500, new Response() { Status = false, Description = "System error" })); } }