
C#
莫逍遥
精益求精,锐意进取
展开
-
Sql缓存依赖
Sql缓存依赖主要分为两种:1.轮询模式(poll model)2.推模式(push model)今天先讲解第一种模式:轮询要使用sql轮询模式,得做三方面的工作:1.对数据库启用缓存依赖2.对一个或多个表启用缓存依赖3.在web.config中配置应用程序一.对数据启用缓存依赖在visual studio command prompt中执行以下命令aspn原创 2012-06-29 23:07:39 · 3692 阅读 · 0 评论 -
如何比较两个集合是否相等
List list1 = new List() { new CustomerInfo(){ ID = 1, Name = "Tom"}, new CustomerInfo(){ ID = 1, Name = "Tom"} }; List list2 = new List() { n原创 2011-05-08 10:29:00 · 828 阅读 · 0 评论 -
List 复制
<br /><br />方法一:<br /> List<string> t = new List<string>(); //original<br /> List<string> t2 = new List<string>(t.ToArray()); // copy of t<br />方法二:<br /> <br />It is a one liner using LINQ. List<string> list1 = new List<string>(); Li原创 2011-03-25 22:37:00 · 872 阅读 · 0 评论 -
Json序列化
当对一个对象进行json序列化的时候,如果某一个字段的值为null值,但是不想对他进行序列化,那么进行一下设置即可解决:[JsonProperty(NullValueHandling=NullValueHandling.Ignore),DefalutValueHandling=DefaultValueHandling.Ignore]public string Name{get;set;}原创 2011-03-24 14:36:00 · 668 阅读 · 0 评论