摘要:1. Linq与 language extension的关系 2.Linq 的触发机制-------Lazy evaluation 真正Request的时候才会被执行。 请单步调试下以下两个程序: static void Main(string[] args) { int[] number = { 1, 2, 3 }; ...
阅读全文
摘要:第一章 一 什么是Linq Linq的起源:在我们的编程过程当中,不得不处理各种各样的数据。There is a gap between your programming language and relation database.(mismatch)在编程语言和关系型数据库之间存在着一定的不匹配。曾经有通过面向对象的数据...
阅读全文
摘要:1.Concat(连接) 连接不同集合的记录,不会过滤相同的记录。 (from c in Customers select c.City).Concat ( from c in Customers select c.Phone ) 注意:City和Phone都是在一列当中 2.Union(合并) 连接不同集合的记录,会过滤相同的记录。 (from c in Customers select...
阅读全文
摘要:MethodInfo[] methods = typeof(string).GetMethods(); var result = from m in methods where m.IsStatic != true select m.Name ; foreach (var r in ...
阅读全文
摘要:1. automatic property 以前 我们 写属性 需要 这样写: public string LastName { get { return _lastName; } set { _lastName = value; ...
阅读全文
摘要:假如你像我一样,无法抵挡这种诱惑,一个页面上放很多个UpdatePanel以及沉溺于Ajax的好处之中。UpdatePanel对于每个人来说都是很容易实现的,它不需要UpdatePanel在后台是怎么操作的。 但是,UpdatePanel在客户端和服务器之间交互的透明缺乏成为你的绊脚石。让我们来看下面这个例子: protected void Button1_Cli...
阅读全文
摘要:http://www.devx.com/codemag/Article/38546 Are you moving a Windows desktop application to the browser, and sweating bullets, or perhaps just not quite sure about how all the new web and data tools wo...
阅读全文
摘要:var larry = new CustomerBuilder().WithName("Larry").WithAge(30).Build(); The fluent interface applied to the code makes it incredibly simple for anyone to ascertain the intent of this code at a glan...
阅读全文
摘要:To be honest, I have to say that my next project will use NHibernate for its persistence technology instead of LINQ to SQL. Why? It is a large project, with a significant number of entities, and we wa...
阅读全文
摘要:LINQ to SQL 常见问题 (LINQ to SQL) 以下各节解答了您在实现 LINQ 时可能遇到的一些常见问题。 其他问题在疑难解答 (LINQ to SQL) 中进行了解答。 无法连接 问:我无法连接到数据库。 答:请确保您的连接字符串是正确的,以及您的 SQL Server 实例正在运行。另请注意,LINQ to SQL 要求启用命名管道协议。有关更多信息,请参见...
阅读全文
摘要:对于我们80后的人来说,感觉一切都变化的很快,计划总是感不上变化。刚刚学习.net 1.1,2.0就出来了,刚刚学习2.0的新特性,wf,wpf,wcf又冒出来了,接着。。。。,又有人开始谈论asp.net 4.0了,说不完的新技术,呵是呵,如何来应对这些新技术呢?我介绍下我的学习方法。 1。新技术入门 这个阶段我认为主要是看一些介绍性的书籍,需要知道新技术它的特点,是用来解决什么...
阅读全文