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