摘要:
最近一段时间,利用空闲时间读了《Effective C# - 50 Specific Ways to Improve Your C#》的第二版,收获不少,尤其是对于.Net 4.0 新特性(PLINQ、Dynamic programming等)的介绍让人眼前一亮,激发了许多新的思路。书是英文的,自己写了些中文的笔记,主要是用于帮助自己记住这些知识点,几乎每个笔记都有知识点的总结和相应的代码。也希望能对大家有所帮助 :)。导航分部分列出各个笔记,以便大家查找方便:) 阅读全文
阅读排行榜
细节决定成败—关于.net的.dll.refresh文件
2010-07-31 14:12 by 小郝(Kaibo Hao), 2571 阅读, 收藏,
摘要:
细节决定成败—关于.net的.dll.refresh文件 阅读全文
Effective C# 学习笔记(四十一)使利用DynamicObject或IDynamicMetaObjectProvider接口实现数据驱动的动态类型
2011-08-02 17:18 by 小郝(Kaibo Hao), 2423 阅读, 收藏,
摘要:
实现动态行为可以帮助解决你编程实践中遇到的各种挑战。当要创建动态类型时,首先判断是否可以通过集成System.Dynamic.DynamicObject来实现。若不能通过继承的方式实现,就要实现IDynamicMetaObjectProvider接口,通过创建继承自DynamicMetaObject类型的嵌套类并重载其对应方法来实现对你要创建的动态类型的属性访问、方法调用等各种动态行为。其中用到了较为复杂的Expression定义,这层抽象较难理解,也较容易出错,请注意这部分逻辑的覆写。另外,用你自己的动态逻辑也要考虑的性能损失的问题,因为动态编程本来就要比静态编程消耗更多的资源,有得必有失么:) 阅读全文
NHibernate Notes3_How to set a default value of column
2011-09-25 22:50 by 小郝(Kaibo Hao), 1952 阅读, 收藏,
摘要:
To set a default value of column with "datetime" type we need to take the advantage of setting the default value of the column within the native DB. In NHibernate we should the set the attritute "generated" to be "alway" or "insert" which will tell NHibernate to fullfill the value of the column with the value assigned from the native DB. Actually there are three value options for the "generated" attribute. 阅读全文
How to deploy the ASP.NET MVC 3 website into the IIS7 on Windows server 2008
2012-02-26 23:33 by 小郝(Kaibo Hao), 1282 阅读, 收藏,
摘要:
Recently, my teammates and I are working closely with our new product. I took a task to build a website which forms as an interface to access the status of the product or do some statistic work with the data which input or output thru the product. This website is build with ASP.NET MVC 3 and C#. Eve 阅读全文
Effective C# 学习笔记(一) 用属性替代公有变量
2011-07-02 23:07 by 小郝(Kaibo Hao), 1179 阅读, 收藏,
摘要:
大家都在说要用 属性 替代 公有变量的声明,但在实践中,很多人说的多做得少,究其原因估计还是不了解其好处何在,看了这篇文章后,应该会有些启发 阅读全文
winform应用使用DataGridView数据导出到Excel
2009-10-18 21:15 by 小郝(Kaibo Hao), 1158 阅读, 收藏,
摘要:
如题,下面是DataGridView到处到Excel的两种方法,附有第二种的工程代码,最近项目使用到这块,就记下来了,其中第一种效率较第二种较高,但是没有第二种容易设置格式:[代码]DataGridViewToExcel.rar 阅读全文
NHibernate学习笔记(2)—关系映射
2009-10-05 22:21 by 小郝(Kaibo Hao), 1148 阅读, 收藏,
摘要:
本次讲讲关系映射。包括一对多、多多的映射,及其相关的SQL、HQL、Criteria查询... 阅读全文
Effective Java Index
2014-05-12 09:04 by 小郝(Kaibo Hao), 923 阅读, 收藏,
摘要:
Hi guys, I am happy to tell you that I am moving to the open source world. And Java is the 1st language I have chosen for this migration. It's a nice chance to read some great books like "Effective Java 2nd Edition" and share the note for what I learned from it with you just as what I did before with CSharp. Here is the index of the notes. Hope you like it :) 阅读全文
Effective C# 学习笔记(四十)使用Dynamic处理匿名类型参数
2011-07-30 20:52 by 小郝(Kaibo Hao), 889 阅读, 收藏,
摘要:
有时你需要在你的方法的参数或返回值中使用匿名类型,而编译器不允许你这么使用匿名类型。你可以使用范型方法,或使用System.Object类型做参数来处理这种问题。但有时你又需要一些特定类型的行为特性来完成你的逻辑,而这个特定类型又不完全被你所掌握,这时你就需要使用Dynamic来处理这个问题。 阅读全文
浙公网安备 33010602011771号