コード例 #1
0
        public async Task <IActionResult> Products()
        {
            var products = await service.GetProductsAsync();

            var models = products.Select(x => new { x.Name, x.Portions, x.Price, x.Id }).ToList();

            return(Ok(models));
        }