SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 31 | Next

Scott Klein

"Professional LINQ"

StartsWith("S")
select fn;
foreach (string name in val)
{
Console.WriteLine(name);
}
}
The first statement defines an array of first names. This should not be new to any developer. The next
statement, however, is new. A local variable, val in this case, is initialized with a Language Integrated
Query expression. The query expression contains two query operators taken from plethora of
standard query operators. In this example, two operators are used: where and select. The local variable
val exposes the IEnumerable interface, which provides the capability to iterate through the
collection. The results are actually created as you start to iterate through them via the foreach statement.
From here, the query can be modified to add sorting or additional filtering as well as many other options,
but that will be expanded on in later chapters. For now, suffice it to say that via LINQ you can query
various source data types, such as XML and relational data, through a standard and consistent query
model and related query operators.


Pages:
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6