If i have the expression:
from p In Product Select p.Name
i understand that p is an Element of Products.
If i have:
Dim allProducts = Products.Select(Function(p) p.Name)
my question is how do i say here that p is an Element of Products?
Because the VB.NET compiler uses Type inference
Thanks to that, the types of the parameters and of the return value of the anonymous method Function(p) p.Name are discovered through the analysis of the signature of .Select() first (to discover the type of p) and then of the type of p.Name (to discover the return value type)
From Basic Instincts: Lambda Expressions
The introduction of powerful type inference mechanisms means that you don't need to worry about figuring out the type of each variable.
and so on... It's quite long.
k. Onlyp.pin the query syntax andpi the method syntax.