Where "m" comes from? MVC

Using MVC:

 <div class="editor-label">@Html.LabelFor(m => m.date_received)</div>
                <div class="editor-field">@Html.TextBoxFor(m => m.date_received)</div>

just wondering where "m" comes from?

I don't see it declared anywhere.

And...is this LINQ or some kind of funky MVC syntax?
Tom KnowltonWeb developerAsked:
Who is Participating?
käµfm³d 👽Connect With a Mentor Commented:
"m" in this case is a variable, which means it can be any arbitrary name--so long as you haven't already defined a variable with that name within the same scope as the lambda.
käµfm³d 👽Commented:
"m => m.date_received" is a lambda expression. Basically, it is a function without a name. In this case, the function takes one parameter (represented by "m"), and the function returns the date_received of each object in the collection being iterated. The type of "m" is inferred by the compiler.

Lambdas are often used as a part of Linq, but they themselves are not Linq.
Tom KnowltonWeb developerAuthor Commented:
so I could use any letter there, or does it have to be "m"?
Tom KnowltonWeb developerAuthor Commented:
Great job on this answer.

Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.