本文介绍了什么是'=>'在C#中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I have seen this code:
myContext.SomeEntities.Single(x => x.code == code);
And I don´t know what does the => operator do.
Every search on google about the operator returns no results.
Thank you.
解决方案
The =>
operator designates a Lambda Expression:
static void Main(string[] args)
{
Func<int, int> func = x => x * x;
int j = func(5);
// j == 25
}
这篇关于什么是'=>'在C#中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!