4 ms·
Unused parameter for lambda function.
by ntnj 13y ago
Unused parameter for lambda function.
- SideburnsOfDoom 13y agoThis is the most accurate reply. The expression Get["/"] = _ => "Hello World!"; is actually of the form a = b; Where "a", i.e. "Get["/"]" is an array-like property (http://msdn.microsoft.com/en-us/library/2549tw02.aspx http://msdn.microsoft.com/en-us/library/2549tw02.aspx ) and the "b" value assigned to it is an anonymous function with one parameter, i.e. _ => "Hello World!" In Nancy these handlers are of the type Func<dynamic, dynamic> ( http://msdn.microsoft.com/en-us/library/bb549151(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/bb549151(v=vs.110).a... ) The parameter could be given any legal name, but an underscore is a convention meaning "I am not using this param".