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

            return View(orders.ToList());
        }
示例#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();
 }