public async Task <ActionResult> AddProduct([FromBody] Product product) { try { var task = Task.Run(() => StockServices.AddProductAsync(product)); await task; return(Ok(task.Result)); } catch (Exception ex) { return(BadRequest(ex)); } }
public async Task <ActionResult> AddProduct([FromBody] Product product) { try { var task = Task.Run(() => StockServices.AddProductAsync(product)); await task; return(Ok(task.Result)); } catch (Exception ex) { return(BadRequest(ex)); } }