Пример #1
0
 public void Add(Product product)
 {
     using (var db = new DbNorthwind())
     {
         db.Insert(product);
     }
 }
Пример #2
0
        public List <Product> All(string name)
        {
            using (var db = new DbNorthwind())
            {
                var query = from p in db.Product
                            where p.Name.Contains(name)

                            select p;
                return(query.ToList());
            }
        }
Пример #3
0
 public List <Product> All()
 {
     using (var db = new DbNorthwind())
     {
         var query = from p in db.Product
                     where p.ProductID > 25
                     orderby p.Name descending
                     select p;
         return(query.ToList());
     }
 }