这是什么=>在c#中意味着什么? (e => e.LocalName) [英] What does this => means in c#? (e => e.LocalName)

查看:103
本文介绍了这是什么=>在c#中意味着什么? (e => e.LocalName)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过这样的地方.net代码正在使用=>符号。例如:

e => e.LocalName



这是什么意思?

我也用Linq语法看过它。这实际上是什么?

解决方案

它被称为lambda运算符,参数指定在运算符的左侧和右侧,您可以指定表达式/语句块。

阅读: Lambda表达式(C#编程指南) [ ^ ]

CP文章:

- LINQ& amp; Lamda表达式 [ ^ ]

- 在C#中探索Lambda表达式 [ ^ ]

- 通往Lambda的方式 [ ^ ]

- C# Delegates,Anonymous Methods和Lambda Expressions - O My! [ ^ ]

=> 中是一个运营商。



详细解释和示例可以在这里找到:

http://msdn.microsoft.com/de-de/library/bb311046.aspx [ ^ ]


它是一个Lambda表达式。



参考:了解Lambda表达式在3分钟内


I have seen so place .net code is using => symbol.For example:
e => e.LocalName

What doe it mean?
I have seen it in Linq syntax also. What is this actually ?

解决方案

it is called lambda operator, parameter specify in the left side and the right side of the operator you can specify the expression/ statement block.
read : Lambda Expressions (C# Programming Guide)[^]
CP articles:
- Basics of LINQ & Lamda Expressions[^]
- Exploring Lambda Expression in C#[^]
- Way to Lambda[^]
- C# Delegates, Anonymous Methods, and Lambda Expressions – O My![^]


"=>" is an operator.

A detailed explanation as well as an example can be found here:
http://msdn.microsoft.com/de-de/library/bb311046.aspx[^]


Its a Lambda Expression.

Reference: Understand Lambda Expressions in 3 minutes


这篇关于这是什么=>在c#中意味着什么? (e => e.LocalName)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆