摘要: 我们在用lambda 表达式的时候,经常会看到以如下:newFunc<in T, out TResult> 格式作为参数形式的扩展方法,比如:Where,Select,Join,GroupJoin ETC.转到函数定义: public delegate TResult Func<in T, out TResult>(T arg);发现Func 是通过委托机制实现的,同时还可以看出各个参数的输入、输出类型这对我们在调用这一系列扩展方法的时候如何正确的传递参数有一定的帮助。 阅读全文
posted @ 2013-05-30 14:12 xust 阅读(615) 评论(0) 推荐(0)
摘要: mDCKeywordsImportantWithoutCat 只包含一条数据(p.keyword_id.Value = 31651368766)hdKeywordId.Value = "31651368766";bool isImportant = mDCKeywordsImportantWithoutCat.Where(p => p.keyword_id.Value == long.Parse(hdKeywordId.Value.Trim())).ToList().Count > 0 ? true : false; //正确(比较值类型)bool isImpo 阅读全文
posted @ 2013-05-30 09:56 xust 阅读(177) 评论(0) 推荐(0)