I've got a pretty noob question for ya. I keep seeing this syntax:
<%= Html.LabelFor(model => model.Email) %>
...and I have no idea what the => means. I thought it was syntax for linq2sql or ado.net entity framework but I'm just using straight ado.net. I don't understand why the VWD used that syntax when generating the Create form.
What does => mean?
it is a lambda expression it means "goes to"
this is a pretty good link for explaining here
the left side is the input the right side the expression or statement block, here you are calling the LabelFor method inputing model and using the Email field on the model passed in.
Take a look at Lambda Expressions (C# Programming Guide)
All lambda expressions use the lambda operator =>, which is read as "goes to". The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x => x * x is read "x goes to x times x."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With