2012年3月4日

重视Linq技术_5

摘要: Building Query Expressions//1、Compiling Expression TreesProducts.DeleteAllOnSubmit (Products.Where (p => p.ID == 999));Products.InsertOnSubmit (new Product { ID = 999, Description = "Test", LastSale = DateTime.Now } );SubmitChanges();Product[] localProducts = Products.ToArray();Expressi 阅读全文

posted @ 2012-03-04 23:47 Sanic 阅读(255) 评论(0) 推荐(0) 编辑

重视Linq技术_4

摘要: //LINQ to SQL//1、Baisc queryCustomers.Single (c => c.ID == 2) .Dump ("Customer With ID Of 2");//2、AssociationsCustomer cust1 = Customers.OrderBy (c => c.Name).First();foreach (Purchase p In cust1.Purchases)Console.WriteLine (p.Price);//3、 Retrieve the customer who made the lowest val 阅读全文

posted @ 2012-03-04 22:43 Sanic 阅读(178) 评论(0) 推荐(0) 编辑

导航