我何时应该使用C#3.0随附的lambda表达式? [英] when should i use lambda expressions which comes with C# 3.0?
本文介绍了我何时应该使用C#3.0随附的lambda表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
伙计们,
今天上午,我的开发人员正在谈论lambda表达式。所以我决定在这里问这个问题
My fellow developers were talking about lambda expressions this morning. So i decided to ask it here in SO
- 我什么时候应该使用C#3.0附带的lambda表达式
?
推荐答案
我认为您的应该
ThreadPool示例:
ThreadPool example:
ThreadPool.QueueUserWorkItem(state => {
// the code to run on separate thread goes here
});
LINQ:
var myItems = GetSomeIEnumerable()
.Where(o => o.SomeProperty.Equals("some value"));
.OrderBy(o => o.SomeOtherProperty);
这篇关于我何时应该使用C#3.0随附的lambda表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文