I have been reading about the LINQ feature of c# and come across the following bit of code:
List<string> myFruitList = new List<string>() {
"apple", "plum", "cherry", "grape", "banana", "pear", "mango" ,
"persimmon", "lemon", "lime", "coconut", "pineapple", "orange"};
var results = from e in myFruitList
where e[0] == 'p' || e[0] == 'l'
group e by new {
FirstChar = e[0],
LengthGt5 = e.Length > 5 //no type mentioned for FirstChar and LengthGt5
};
What I am unable to understand is no type was mentioned for FirstChar
(char) and LengthGt5
(bool) fields. I am pretty confused. Please clear the doubts.
Thanks in advance.