Inheritance: System.Data.Linq.DataContext
Exemplo n.º 1
0
        public ActionResult Orders(string id)
        {
            var dataContext = new NorthwindDataContext();
            var orders = dataContext.Orders.Where(o => o.CustomerID == id);

            return View(orders.ToList());
        }
Exemplo n.º 2
0
 private IList<string> GetAllCustomers()
 {
     var dataContext = new NorthwindDataContext(@"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True");
     return dataContext.Customers.Select(c => c.CustomerID).ToList();
 }