コード例 #1
0
        public async Task <ActionResult> AddCatalogItemAsync([FromBody] CatalogItemDto catalogItem)
        {
            try
            {
                await _catalogService.AddITemToCatalogAsync(catalogItem);

                return(Created("Item added to catalog.", catalogItem));
            }
            catch (Exception ex)
            {
                return(BadRequest($"{ex.Message} \n {ex.InnerException.Message}"));
            }
        }