コード例 #1
0
        public async Task <IActionResult> GetCatalog([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var catalog = await service.FindCatalogItemByAsync(id);

            if (catalog == null)
            {
                return(NotFound());
            }

            return(Ok(catalog));
        }