public async Task <ActionResult <Category> > PostCategory(Category category) { category = await _inventoryService.CreateCategoryAsync(category); if (category == null) { return(BadRequest()); } return(CreatedAtAction(nameof(GetCategory), new { id = category.Id }, category)); }