コード例 #1
0
        public async Task <Product> GetByIdAsync(string id)
        {
            var products = await SwordsContext.GetProductsAsync();

            var product = products.FirstOrDefault(p => p.ProductId == id);

            return(product);
        }
コード例 #2
0
        public async Task <IEnumerable <Product> > GetAllAsync()
        {
            var products = await SwordsContext.GetProductsAsync();

            return(products);
        }