【发布时间】:2011-07-12 10:10:12
【问题描述】:
有什么区别
Class1.Method1<Guid, BECustomer>("cId", Facade.Customers.GetSingle);
和
Class1.Method1<Guid, BECustomer>("cId", x => Facade.Customers.GetSingle(x));
?
Resharper 建议使用第一个表达式。
【问题讨论】:
-
在 C# 中没有语义差异。在 Java 中,类似的事物类型会导致 'this' 的不同绑定!我一直被这个咬住......
标签: c# lambda method-group