public ActionResult Get(string employeeID) { EmployeeInformation employeeRecord = _employeAdapter.GetByUniqueID(employeeID); if (string.IsNullOrEmpty(employeeRecord.Employee.EmployeeID)) { return(BadRequest(string.Format($"Given EmployeeID: {employeeID} didnot return any employee data. Please provide a valid employee ID"))); } string result = JsonConvert.SerializeObject(employeeRecord); return(Ok(result)); }
public ActionResult Get(string employeeID) { EmployeeInformation employeeRecord = _employeAdapter.GetByUniqueID(employeeID); if (string.IsNullOrEmpty(employeeRecord.Employee.EmployeeID)) { return(BadRequest(string.Format($"Given EmployeeID: {employeeID} doesnot exist. Please provide the right employeeID"))); } EmployeeSalaryInformation _salary = _benefitCostCalculator.CalculateEmployeeSalary(employeeRecord); string result = JsonConvert.SerializeObject(_salary); return(Ok(result)); }