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 137 | Next

Scott Klein

"Professional LINQ"

Items.Add(num);
The results are as follows:
5
10
15
20
25
Repeat
The Repeat operator creates a single value sequence that repeats itself a specified number of
times. The following example creates a sequence of a single string value and repeats that string
10 times:
var coolphrase = Enumerable.Repeat("LINQ ROCKS!", 10);
for each (string phrase in coolphrase)
listbox1.Items.Add(phrase);
The result of this query is the phrase ??????LINQ ROCKS!??™??™ output 10 times to the list box.
Conversion Operators
Conversion refers to the act of changing the type of input objects to the sequence. The conversion
operators do just this, and they are discussed in this section.
73
Part I: Introduction to Project LINQ
AsEnumerable
The AsEnumerable operator returns the query input typed as IEnumerable(Of T), meaning that you can
change the data source from a type that implements IEnumerable(Of T) to IEnumerable(Of T) itself.
The following example uses the AsEnumerable operator to replace the type??™s custom Where method with
that of the standard query operator Where.


Pages:
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6