Пример #1
0
        public async Task <IEnumerable <ApiProduct> > GetAsync()
        {
            //return new[] { new ApiProduct { Id = Guid.NewGuid(), Description = "fake" } };

            IEnumerable <Product> allProduct = await _service.GetAllProductsAssync();

            return(allProduct.Select(p => new ApiProduct
            {
                Id = p.Id,
                Name = p.Name,
                Description = p.Description,
                Price = p.Price,
                IsAvailability = p.Availability > 0
            }));
        }