08 2013 档案

摘要:ORM TipsORM小窍门More and more people are using Object to Relational Mapping (ORM) tools to jump the divide between application code that is object oriented and a database that is storing information in a relational manner. These tools are excellent and radically improve development speed. But, there a 阅读全文
posted @ 2013-08-30 14:08 安布雷拉 阅读(439) 评论(0) 推荐(0)
摘要:(41)StringBuilder is NOT the answer for all string concatenation scenarios; String.Join could be招数41:StringBuilder不适用于所有字符串连接的场景;String.Join可能是Yes, if you are in a loop and adding to a string, then a StringBuilder *could* be most appropriate. However, the overhead of spinning up a StringBuilder inst 阅读全文
posted @ 2013-08-27 12:55 安布雷拉 阅读(399) 评论(0) 推荐(0)
摘要:(40)Take advantage of .NET 4.5 async constructs招数40:利用.NET 4.5异步结构With the arrival of .NET 4.5, writing async code correctly is easier than ever. Like any tool, it should be only applied where it makes most sense – in web use-cases this usually revolves around I/O operations (i.e. reading from disk, 阅读全文
posted @ 2013-08-22 15:12 安布雷拉 阅读(307) 评论(0) 推荐(0)
摘要:(39)Avoid using session state招数39:避免使用会话状态Where possible, you should try and avoid using session state. Whilst using one web server, performance is usually not a problem. This changes as soon as you need to scale to multiple servers, as different, and usually slower, techniques need to be used.如果可能, 阅读全文
posted @ 2013-08-20 17:27 安布雷拉 阅读(282) 评论(0) 推荐(0)
摘要:(32)Seven handy ViewState tips招数32:7条便利的ViewState技巧Every time I have to deal with a classic ASP.NET Web Forms application, one of the first things I look at is the resulting source, to check whether the DOM is a complete mess and whether the ViewState is an enormous, unnecessary blob of ugliness. Us 阅读全文
posted @ 2013-08-02 15:44 安布雷拉 阅读(384) 评论(0) 推荐(0)
摘要:(31)Know your loops招数31:认识你的循环for is the fastest way of iterating over a collection, foreach is a little slower, and LINQ queries are slowest.for是遍历集合最快的方法,foreach略慢一些,LINQ查询最慢。测试代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Diagn 阅读全文
posted @ 2013-08-01 14:13 安布雷拉 阅读(664) 评论(1) 推荐(0)