public async Task <IActionResult> PostEmployee(Employee employee) { DBStateKey updateState = await EmpService.AddNewEmployee(employee); if (updateState != DBStateKey.Success) { return(StatusCode(500, DBState[updateState])); } return(Ok(DBState[updateState])); }
public async Task <ActionResult <Employee> > DeleteEmployee(int id) { DBStateKey updateState = await EmpService.DeleteEmployee(id); if (updateState != DBStateKey.Success) { return(StatusCode(500, DBState[updateState])); } return(Ok(DBState[updateState])); }
public async Task <IActionResult> PutEmployeeAsync(int id, Employee employee) { DBStateKey updateState = await EmpService.UpdateEmployee(id, employee); if (updateState != DBStateKey.Success) { return(StatusCode(500, DBState[updateState])); } return(Ok(DBState[updateState])); }