#27:Linq Query Operators

The Query Operators takes the Following delegate Generic Types

1.Tsource-Input sequence.

2.TResult-Output Sequence.

3.TKey-Key used for order,sorting,grouping.

string[] names = { "Rangesh", "Tom", "Jon"};
var outerQuery = names.OrderBy(n2 => n2.Length).Select(n2 => n2.Length).First();

In the above sample,the OrderBy has the Generic delegate type where Source= names and Key=Length

public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s