public IActionResult SetEmployeeCompensation([FromBody] Compensation compensation) { _logger.LogDebug($"Received employee post compensation request for '{compensation.Employee.EmployeeId}'"); var employee = _employeeService.GetById(compensation.Employee.EmployeeId); if (employee == null) { return(NotFound()); } _employeeService.AddCompensation(compensation); return(CreatedAtRoute("getEmployeeCompensation", new { id = employee.EmployeeId }, compensation));; }