<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_leeolevis_分类_微软集</title><id>http://feed.cnblogs.com/blog/u/51427/category/315276/rss</id><updated>2012-06-03T19:44:32Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/category/315276.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/51427/category/315276/rss"/><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/07/13/1776521.html</id><title type="text">Linq to SQL 加注Data Annotation在 Asp.Net MVC2中的应用</title><summary type="text">首先我们来做一个比较，自定义Model加Annotation，如表1所示：图表1：Product Class 的定义Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--&gt; 1 public class Product 2 { 3 [DisplayName("Product Name")] 4 [Required(ErrorMessage="Product Name is Required.")] 5 [Str</summary><published>2010-07-13T07:31:00Z</published><updated>2010-07-13T07:31:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/07/13/1776521.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/07/13/1776521.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/07/13/1776509.html</id><title type="text">Linq之动态排序（字符传入）</title><summary type="text">Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--&gt;staticclassProgram{staticvoidMain(string[]args){string[]array={"aaa","bb","c"};foreach(variteminarray.AsQueryable().OrderBy("Length")){Console.WriteLine(item);</summary><published>2010-07-13T07:18:00Z</published><updated>2010-07-13T07:18:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/07/13/1776509.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/07/13/1776509.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/07/09/1774491.html</id><title type="text">EneityFramework+DomainDataSource+Silverlight完成数据读取分页排序与修改</title><summary type="text">关于EF、SL、DomainDataSource的说明园子上够多了，这儿就不多说了。 1.安装VS2010与Silverlight 4 Tools…… 2.打开VS2010,新键Silverlight项目,如图一所示:图1.新键项目 注:请选中"启用WCF RIA服务"的CheckBox. 建立好项目后,解决方案里的文件如图2所示:图2.解决方案文件结构 3.在SilverlightApplication.Web里,添加Entity Framework的数据库映射文件,这儿我以自己数据库的一个表所为示例,如图3与图3所示:图3.新建"Ado.Net实体数据模型&amp;q</summary><published>2010-07-09T08:53:00Z</published><updated>2010-07-09T08:53:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/07/09/1774491.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/07/09/1774491.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/07/04/1770707.html</id><title type="text">单元测试之道（使用NUnit）</title><summary type="text">首先来看下面几个场景你是否熟悉 1、你正在开发一个系统，你不断地编码-编译-调试-编码-编译-调试……终于，你负责的功能模块从上到下全部完成且编译通过！你长出一口气，怀着激动而又忐忑的心情点击界面上的按钮，顿时你刚刚的轻松感烟消云散：系统无法正常工作，你想读的数据显示不出来，你想存的东西也送不到数据库……于是，你再次回到IDE里，设断点、调试、一层一层跟踪，当你精疲力尽终于将数据送到数据库里，你又发现了其它问题，于是你继续设断点、调试、编译、调试…… 2、你狂躁地敲击着键盘和鼠标，咒骂着不断出现的bug：啊？这里怎么没返回值啊！哎？这里不该是0啊！不对啊，这里怎么没数据……你永远不知道还有多少</summary><published>2010-07-03T16:55:00Z</published><updated>2010-07-03T16:55:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/07/04/1770707.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/07/04/1770707.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/05/21/1740640.html</id><title type="text">linq to sql 系列之 linq to sql性能优化技巧</title><summary type="text">linq to sql 是一个代码生成器和ORM工具，他自动为我们做了很多事情，这很容易让我们对他的性能产生怀疑。但是也有几个测试证明显示在做好优化的情况下，linq to sql的性能可以提升到ado.net datareader性能的93%。因此我总结了linq to sql的10个性能提升点，来优化其查询和修改的性能。1. 不需要时要关闭 DataContext的ObjectTrackingEnabled 属性view source print?1using (NorthwindDataContext context = new NorthwindDataContext()) 2{ 3c</summary><published>2010-05-21T01:49:00Z</published><updated>2010-05-21T01:49:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/05/21/1740640.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/05/21/1740640.html"/><content type="text">linq to sql 是一个代码生成器和ORM工具，他自动为我们做了很多事情，这很容易让我们对他的性能产生怀疑。但是也有几个测试证明显示在做好优化的情况下，linq to sql的性能可以提升到ado.net datareader性能的93%。因此我总结了linq to sql的10个性能提升点，来优化其查询和修改的性能。1. 不需要时要关闭 DataContext的ObjectTrackingEnabled 属性view source print?1using (NorthwindDataContext context = new NorthwindDataContext()) 2{ 3c</content></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/04/14/1712243.html</id><title type="text">北京 Visual Studio 2010 /*CODING完美世界*/</title><summary type="text">北京 Visual Studio 2010 /*CODING完美世界*/ 2010年4月12日1.张亚勤博士致辞2.谢恩伟演讲3.潘正磊主题演讲4.做你的Code主角煽情对白5.上午会议结束，集体与潘总合影6.午餐7.社区交友带领同事们认识社区精英计划的朋友8.参与社区精英计划活动，开展主题宣传，成功完成了200人的社区招募！9.下午会开始。10.跟随terryFeng Leader 结交诸多豪杰，诸如：葛涵涛，肖正波，高阳等11.社区精英计划合影12.散会，大家一起聚餐总结今天的收获。 此番旅程，收获颇多!在此感谢terryfeng，农姐，潘总。还感谢我的诸多同事：周雪峰，程学斌，朱加昭，周</summary><published>2010-04-14T15:21:00Z</published><updated>2010-04-14T15:21:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/04/14/1712243.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/04/14/1712243.html"/><content type="text">北京 Visual Studio 2010 /*CODING完美世界*/ 2010年4月12日1.张亚勤博士致辞2.谢恩伟演讲3.潘正磊主题演讲4.做你的Code主角煽情对白5.上午会议结束，集体与潘总合影6.午餐7.社区交友带领同事们认识社区精英计划的朋友8.参与社区精英计划活动，开展主题宣传，成功完成了200人的社区招募！9.下午会开始。10.跟随terryFeng Leader 结交诸多豪杰，诸如：葛涵涛，肖正波，高阳等11.社区精英计划合影12.散会，大家一起聚餐总结今天的收获。 此番旅程，收获颇多!在此感谢terryfeng，农姐，潘总。还感谢我的诸多同事：周雪峰，程学斌，朱加昭，周</content></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2009/12/12/1622366.html</id><title type="text">设计模式学习笔记简述</title><summary type="text">创建型模式1.抽象工厂模式（Abstract Factory）：提供一个创建一系列或相关依赖对象的接口，而无需指定它们具体的类。2.建造者模式（Builder）：将一个浮躁对象的构建与它的表示分离，使得同样的构建过程可以创建不同的表示。3.工厂模式（Factory ）：定义一个用于创建对象的接口，让子类决定实例化哪一个类，工厂模式使一个类的实例化延迟到其子类。4.原型模式（Prototype）：用原型实例指定创建对象的种类，并且通过拷贝这些原型创建新的对象。5.单例模式（Singleton）：保证一个类仅有一个实例，并提供一个访问它的全局访问点。结构型模式 6.适配器模式（Adapter）：将</summary><published>2009-12-12T02:47:00Z</published><updated>2009-12-12T02:47:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2009/12/12/1622366.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2009/12/12/1622366.html"/><content type="text">创建型模式1.抽象工厂模式（Abstract Factory）：提供一个创建一系列或相关依赖对象的接口，而无需指定它们具体的类。2.建造者模式（Builder）：将一个浮躁对象的构建与它的表示分离，使得同样的构建过程可以创建不同的表示。3.工厂模式（Factory ）：定义一个用于创建对象的接口，让子类决定实例化哪一个类，工厂模式使一个类的实例化延迟到其子类。4.原型模式（Prototype）：用原型实例指定创建对象的种类，并且通过拷贝这些原型创建新的对象。5.单例模式（Singleton）：保证一个类仅有一个实例，并提供一个访问它的全局访问点。结构型模式 6.适配器模式（Adapter）：将</content></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2009/12/12/1622364.html</id><title type="text">IEnumerable&amp;lt;T&amp;gt;接口主要成员</title><summary type="text">在LINQ中，数据源和查询结果实际上都是IEnumerable&lt;T&gt;或IQueryable&lt;T&gt;类型对象，所以可以通过使用普通对象的形式（调用方法、使用属性等）对数据源进行查询或使用查询结果数据。1.IEnumerable&lt;T&gt;接口IEnumerable&lt;T&gt;泛型接口支持在制定数据集合上进行迭代操作。它定义了一组扩展方法，用来对数据集合中的元素进行遍历、过滤、排序、搜索等操作。在LINQ中，数据源实际上是实现了接口IEnumerable&lt;T&gt;的类，通过select子句返回的查询结果页是一个实现了IEnumerable&lt;T&gt;</summary><published>2009-12-12T02:45:00Z</published><updated>2009-12-12T02:45:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2009/12/12/1622364.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2009/12/12/1622364.html"/><content type="text">在LINQ中，数据源和查询结果实际上都是IEnumerable&lt;T&gt;或IQueryable&lt;T&gt;类型对象，所以可以通过使用普通对象的形式（调用方法、使用属性等）对数据源进行查询或使用查询结果数据。1.IEnumerable&lt;T&gt;接口IEnumerable&lt;T&gt;泛型接口支持在制定数据集合上进行迭代操作。它定义了一组扩展方法，用来对数据集合中的元素进行遍历、过滤、排序、搜索等操作。在LINQ中，数据源实际上是实现了接口IEnumerable&lt;T&gt;的类，通过select子句返回的查询结果页是一个实现了IEnumerable&lt;T&gt;</content></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2009/12/11/1621870.html</id><title type="text">SQL LinqToSql Lambda QA</title><summary type="text">1、 查询Student表中的所有记录的Sname、Ssex和Class列。 select sname,ssex,class from student Linq: from s in Students select new { s.SNAME, s.SSEX, s.CLASS } Lambda: Students.Select( s =&gt; new { SNAME = s.SNAME,SSEX = s.SSEX,CLASS = s.CLASS }) 2、 查询教师所有的单位即不重复的Depart列。 select distinct depart from teacher Linq: fro</summary><published>2009-12-11T05:54:00Z</published><updated>2009-12-11T05:54:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2009/12/11/1621870.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2009/12/11/1621870.html"/><content type="text">1、 查询Student表中的所有记录的Sname、Ssex和Class列。 select sname,ssex,class from student Linq: from s in Students select new { s.SNAME, s.SSEX, s.CLASS } Lambda: Students.Select( s =&gt; new { SNAME = s.SNAME,SSEX = s.SSEX,CLASS = s.CLASS }) 2、 查询教师所有的单位即不重复的Depart列。 select distinct depart from teacher Linq: fro</content></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2009/12/07/1618381.html</id><title type="text">ASP.NET MVC Membership 权限 漫谈</title><summary type="text">以前一位同事习惯于使用Membership来进行权限管理，现在随着ASP.NET MVC的引入，采用以前的方法，提出了以下方案：ASP.NET MVC+Membership结合，通过在web.config中进行配置，来管理系统中的权限。 于是，我对这个方案的可行性进行了分析，提出了以下疑点：在ASP.NET 2.0的Membership中， 在Web.config中是通过物理文件和目录，那么在ASP.NET MVC中，如果在URL中直接输入物理文件和目录，是找不到这个文件的，不知道这种方式还能不能奏效。如果说不管在mvc中，通过URL Routing怎么绕，最终都会定位到物理文件和目录上，这种</summary><published>2009-12-07T02:07:00Z</published><updated>2009-12-07T02:07:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2009/12/07/1618381.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2009/12/07/1618381.html"/><content type="text">以前一位同事习惯于使用Membership来进行权限管理，现在随着ASP.NET MVC的引入，采用以前的方法，提出了以下方案：ASP.NET MVC+Membership结合，通过在web.config中进行配置，来管理系统中的权限。 于是，我对这个方案的可行性进行了分析，提出了以下疑点：在ASP.NET 2.0的Membership中， 在Web.config中是通过物理文件和目录，那么在ASP.NET MVC中，如果在URL中直接输入物理文件和目录，是找不到这个文件的，不知道这种方式还能不能奏效。如果说不管在mvc中，通过URL Routing怎么绕，最终都会定位到物理文件和目录上，这种</content></entry></feed>
