Esempio n. 1
0
        static void Main(string[] args)
        {
            using (var db = new NorthWindContext())
            {
                var query = from p in db.Products
                            orderby p.ProductName
                            select p;

                Console.WriteLine("All products in db");
                foreach (var item in query)
                {
                    Console.WriteLine(item.ProductName);
                }
                Console.WriteLine("Press any key to exit...");
                Console.ReadKey();
            }
        }
 public ProductRepository(NorthWindContext context)
 {
     _context = context;
 }
 public NorthWindRepository(NorthWindContext context)
 {
     _context = context;
 }