问题描述
我一直在深入研究LINQ,并且我试图对这个lambda表达式业务进行哈希处理.我只是没有看到语法的一些细微差别的好处.首先,在我看来,lambda表达式主要只是使用Where子句的另一种方式.那我为什么不只使用Where子句呢? Lambda表达式更有效吗?
I've been really digging into LINQ, and I'm trying to hash out this lambda expression business. I'm just not seeing the benefit of some of the nuances of the syntax. Primarily, it seems to me that a lambda expression is mostly just a different way of using a Where clause. Why wouldn't I just use a Where clause then? Is the lambda expression more efficient?
吸引另一组程序员来使用C#感到更仅仅是语法上的补充吗?我还没有接触过的lambda表达式还有其他更好的用例吗?
Is it just another syntactical addition to draw programmers from another group to feel more comfortable in C#? Are there other better use cases for lambda expressions that I just haven't exposed to yet?
推荐答案
看看本文: LINQ查询语法与方法语法:
Take a look at this article: LINQ Query Syntax versus Method Syntax:
还有这个问题: LINQ:点表示法与查询表达式
这篇关于何时在LINQ中使用Lambda表达式代替Where子句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!