Restriction Operator- Where
The Where operator filters a sequence based on a predicate.
public static IEnumerable<TSource> Where<TSource>( this IEnumerable<TSource> source, Func<TSource, bool> predicate);
public static IEnumerable<TSource> Where<TSource>( this IEnumerable<TSource> source, Func<TSource, int, bool> predicate);
The Where operator allocates and returns an enumerable object that captures the arguments passed to the operator. An ArgumentNullException is thrown if either argument is null.
This example each element of an input integer array whose value is less than 5. The example uses a query expression to create a new sequence of integers and then iterates over each element in the sequence, printing its value.
| using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication2 } |
Output:
Aspnet Discussion
- - Web application
- - Great Indian Developer Su
- - Aspx page inside Silverli
- - Open aspx page inside Sil
- - Guidance for a novice





