public async Task <IActionResult> Post([FromBody] EmployeeViewModel input, CancellationToken ct = default(CancellationToken)) { try { if (input == null) { return(BadRequest()); } return(Ok(await _chinookSupervisor.AddEmployeeAsync(input, ct))); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public async Task <ActionResult <EmployeeResponse> > Post([FromBody] EmployeeResponse input, CancellationToken ct = default) { try { if (input == null) { return(BadRequest()); } return(StatusCode(201, await _chinookSupervisor.AddEmployeeAsync(input, ct))); } catch (Exception ex) { return(StatusCode(500, ex)); } }