public async Task <ActionResult> ListProducts() { try { var task = Task.Run(() => StockServices.ListAllProducts()); await task; return(Ok(task.Result)); } catch (Exception ex) { return(BadRequest(ex)); } }
public async Task <ActionResult> ListProducts() { try { var task = Task.Run(() => StockServices.ListAllProducts()); await task; return(Ok(task.Result)); } catch (Exception ex) { return(BadRequest(ex)); } }