Solved

What is this operator, "=>", do in Asp.net MVC?

Posted on 2014-11-09
2
599 Views
Last Modified: 2014-11-09
@Html.DisplayFor(modelItem => item.TableNum)
Trying to learn MVC, what is this code doing?

Thank you,
0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 40431774
It introduces a lambda expression, which is kind of like an anonymous function--or a function that you don't give a name to. Lamda's are useful in scenarios where you have logic that depends on being passed a behavior rather than a piece of data. When I say "behavior," I basically mean a piece of functionality.

In your case, your lamda effectively passes the value of what is in the TableNum property to the DisplayFor method. The end result is that a <label> is spit out into your HTML for the data that TableNum holds.
0
 

Author Closing Comment

by:lapucca
ID: 40431864
Thank you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question