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