public async Task <IActionResult> Post([FromBody] InvoiceViewModel input, CancellationToken ct = default(CancellationToken))
 {
     try
     {
         if (input == null)
         {
             return(BadRequest());
         }
         return(Ok(await _chinookSupervisor.AddInvoiceAsync(input, ct)));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex));
     }
 }
Example #2
0
        public async Task <ActionResult <InvoiceResponse> > Post([FromBody] InvoiceResponse input,
                                                                 CancellationToken ct = default)
        {
            try
            {
                if (input == null)
                {
                    return(BadRequest());
                }

                return(StatusCode(201, await _chinookSupervisor.AddInvoiceAsync(input, ct)));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex));
            }
        }