I had a query regarding how parameter types in a lambda expression are evaluated.
If we're querying an IEnumerable of type Customer and have a statement such as customers.Where(c => c.City == "London"), c is of type Customer.
In HTML Helpers used in ASP.NET MVC 3 if we have a statement like Html.TextBoxFor(c => c.Foo) in a strongly typed view, c is of type that the view is bound to.
What I don't understand is how the compiler and visual studio intellisense know the type of the parameters in the lambda. The MSDN documentation says "the compiler can infer the type based on the lambda body, the underlying delegate type, and other factors as described in the C# Language Specification". However I don't get how the lambda body or the delegate type allow the compiler to determine what the data type of the parameter is.
Cheers,