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