随笔分类 -  LINQ标准查询操作符

摘要:public class Skip_LINQ { public static void Skip_Print() { int[] random = { 87, 2, 76, 90, 100, 65, 5, 22, 70 }; //IEnumerable<int> query = random.OrderBy(r => r).Skip(4); IEnumerable<int&... 阅读全文
posted @ 2010-04-17 22:09 CityWalker 阅读(347) 评论(0) 推荐(0)
摘要:public class All_LINQ { public static void All_Print() { int[] num = { 1, 2, 34, 54, 45, 63, 90 }; Console.WriteLine(num.All(c => c % 2 == 0)); Console.WriteLine(num.All(c => c>= 0)); } publi... 阅读全文
posted @ 2010-04-17 22:08 CityWalker 阅读(243) 评论(0) 推荐(0)
摘要:public class SequenceEqual_LINQ { public static void SequenceEqual_Print() { int[] numbers1 = { 1, 2, 3, 4, 5, 4, 5 }; int[] numbers2 = { 1, 2, 3, 4, 5, 4, 5 }; int[] numbers3 = { 1, 2, 3, 4, 5 }; Con... 阅读全文
posted @ 2010-04-17 22:07 CityWalker 阅读(198) 评论(0) 推荐(0)
摘要:public class DefaultIfEmpty_LINQ { static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); static DataContext context = new DataContext(Contex... 阅读全文
posted @ 2010-04-17 22:05 CityWalker 阅读(228) 评论(0) 推荐(0)
摘要:public class AsEnumerable_LINQ { static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); static DataContext context = new DataContext(ContextS... 阅读全文
posted @ 2010-04-17 22:02 CityWalker 阅读(283) 评论(0) 推荐(0)
摘要:public class Empty_LINQ { public static void Empty_Print() { string[] name1 = { "Asfs", "Steve" }; string[] name2 = { "Joe", "Jhon", "Sawyer", "Sayid" }; string[] name3 = { "Dave", "Kate", "Juliet", "... 阅读全文
posted @ 2010-04-17 22:01 CityWalker 阅读(180) 评论(0) 推荐(0)
摘要:public class Distinct_LINQ { public static void Distinct_Print() { List<int> quantity = new List<int> { 1, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 9, 10 }; IEnumerable<int> val = quantity.Dist... 阅读全文
posted @ 2010-04-17 21:59 CityWalker 阅读(321) 评论(0) 推荐(0)
摘要:public class Aggregate_LINQ { static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); static DataContext context = new DataContext(ContextStri... 阅读全文
posted @ 2010-04-17 21:56 CityWalker 阅读(307) 评论(0) 推荐(0)
摘要:public class Concat_LINQ { static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); static DataContext context = new DataContext(ContextString)... 阅读全文
posted @ 2010-04-17 21:38 CityWalker 阅读(192) 评论(0) 推荐(0)
摘要:public class GroupBy_LINQ { static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); static DataContext context = new DataContext(ContextString... 阅读全文
posted @ 2010-04-17 21:34 CityWalker 阅读(577) 评论(0) 推荐(0)
摘要:public class Join_LINQ { static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); static DataContext context = new DataContext(ContextString);... 阅读全文
posted @ 2010-04-17 21:26 CityWalker 阅读(249) 评论(0) 推荐(0)
摘要:public class OrderBy_LINQ { static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); static DataContext context = new DataContext(ContextStrin... 阅读全文
posted @ 2010-04-17 21:20 CityWalker 阅读(276) 评论(0) 推荐(0)
摘要:public class Where_LINQ { public static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); public static void Print() { DataContext context = n... 阅读全文
posted @ 2010-04-17 21:17 CityWalker 阅读(193) 评论(0) 推荐(0)
摘要:public class Select_LINQ { public static string ContextString = System.Configuration.ConfigurationSettings.AppSettings["ContextString"].ToString(); public static void Print() { DataContext context = ... 阅读全文
posted @ 2010-04-17 21:14 CityWalker 阅读(291) 评论(0) 推荐(0)
摘要:LINQ标准查询操作符一、 概述  标准查询操作符是形成LINQ模式的一系列方法的集合,并通过各自的LINQ提供程序来实现,而LINQ模式则是创建查询表达式来投影、过滤、分组和转换数据的一种标准方式。标准查询操作符提供了查询任何实现了IEnumerable接口和IQueryable接口的对象的能力。二、标准查询操作符1. 投影操作符2. 限制操作符3. 排序操作符4. 联结操作符5. 分组操作符6... 阅读全文
posted @ 2010-04-06 19:35 CityWalker 阅读(186) 评论(0) 推荐(0)

天天来