コード例 #1
0
        public List <Product> GetProductsByCategoryId(int categoryId)
        {
            List <Product> response = null;

            response = MockProducts.GetProducts().Where(p => p.CategoryId == categoryId).ToList();
            return(response);
        }
コード例 #2
0
        public Product GetProductById(int id)
        {
            Product response = null;

            response = MockProducts.GetProducts().Where(p => p.Id == id).FirstOrDefault();

            return(response);
        }
コード例 #3
0
 public List <Product> GetProducts()
 {
     return(MockProducts.GetProducts());
 }