什么"()=>"在C#是什么意思? [英] What does "() =>" mean in C#?

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

问题描述

遇到在复合应用程序指南以下行。



我知道在 => 是一个lambda但到底是什么在()的意思吗?



这有什么其他一些例子?



这是什么叫,所以我可以为它进行搜索?

  this.regionViewRegistry.RegisterViewWithRegion(RegionNames.SelectionRegion 
,()=> ; this.container.Resolve< EmployeesListPresenter>()查看)。


解决方案

这是一个lambda表达式,取0参数



http://msdn.microsoft.com/en-美国/库/ bb397687.aspx


Came across the following line in the Composite Application Guidelines.

I know the => is a lambda but what does the () mean?

What are some other examples of this?

What is it called so I can search for it?

this.regionViewRegistry.RegisterViewWithRegion(RegionNames.SelectionRegion
        , () => this.container.Resolve<EmployeesListPresenter>().View);

解决方案

It's a lambda expression that takes 0 arguments

http://msdn.microsoft.com/en-us/library/bb397687.aspx

这篇关于什么&QUOT;()=&GT;&QUOT;在C#是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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