コード例 #1
0
        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));
        }