What’s the difference between
Class1.Method1<Guid, BECustomer>("cId", Facade.Customers.GetSingle);
and
Class1.Method1<Guid, BECustomer>("cId", x => Facade.Customers.GetSingle(x));
?
Resharper suggests to use the first expression.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no difference in regards to the result. However, the second one creates an additional redirection: The code will first call your anonymous method the takes one parameter named
xand that in turn callsFacade.Customers.GetSinglewith that parameter. This redirection has no benefit at all, that’s why ReSharper tells you to use the first alternative.