Diagnosing ASP.NET MVC Problems | Brad Wilson

If you want to find out why your MVC application isn’t working you can use MvcDiagnostics. It’s a single WebForms page can be dropped into any MVC site, and then viewed in your browser.


You can find a detailed explanation here: Diagnosing ASP.NET MVC Problems | Blog ‘Brad Wilson’

Here’s how to install this tool: ASP.NET MVC Diagnostics Using NuGet | Blog ‘You’ve Been Haacked’

Don’t worry about the old blog post date – this tool is up to date: Microsoft ASP.NET MVC Diagnostics 5.2.3 | NuGet Gallery

Lambda expression in @Html.DisplayFor(modelItem => item.FirstName)

I found a very good explanation about the Lambda expression in @Html.DisplayFor(modelItem => item.FirstName), see Link below.


As the author wrote, a lambda expression is a way to write an anonymous function. As a summary you can find here the lambda expression and its anonymous function it could be translated logically.

Common lambda expression

(x => x.Name)

>>>>>> translates to >>>>>>

string Function(Data x) 
 return x.Name 

Lambda expression without left-side parameter

(() => someVariable)

>>>>>> translates to >>>>>>

string Function() 
 return someVariable; 

Lambda expression in @Html.DisplayFor(model => item.FirstName)

model => item.FirstName

>>>>>> translates to >>>>>>

string Function(Model model) 
 return item.FirstName; 


Here you find the complete post: I want to understand the lambda expression in @Html.DisplayFor(modelItem => item.FirstName)