public async Task <IActionResult> Post([FromBody] WeekAddDto week) { try { var id = await _weekService.AddAsync(week); var saveResult = await _weekService.SaveAsync(); if (saveResult == 0) { _logger.LogError("Unable to add a new week at this time"); return(StatusCode(StatusCodes.Status500InternalServerError)); } return(Ok(id)); } catch (Exception exception) { _logger.LogError(exception, "An error occurred while trying to add a new week"); return(StatusCode(StatusCodes.Status500InternalServerError)); } }