I\'m just learning C# and MVC, and trying to understand some examples.
@Html.EditorFor(m => m)
Eventually I figured out that \'=>\' is the l
Think of the =>
operator as meaning "goes to", so (m => m)
means "m goes to m", another way of saying you get back the same thing m
.
In your example, @Html.EditorFor(m => m)
, m
is an anonymous input parameter to the lambda expression m => m
, which is an argument of the extension method EditorFor
. As you noted in your question, none of the overloads for this method take less than a single parameter; this is because it is an Extension Method and the first parameter indicates the type it extends. The second parameter is an Expression, and you can use lambda expressions for these.