using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
namespace System.Linq
{
/// Provides a set of static (Shared in Visual Basic) methods for querying data structures that implement .
// Token: 0x02000042 RID: 66
public static class Queryable
{
// Token: 0x060003A5 RID: 933 RVA: 0x00011018 File Offset: 0x0000F218
private static MethodInfo MakeGeneric(MethodBase method, params Type[] parameters)
{
return ((MethodInfo)method).MakeGenericMethod(parameters);
}
// Token: 0x060003A6 RID: 934 RVA: 0x00011028 File Offset: 0x0000F228
private static Expression StaticCall(MethodInfo method, params Expression[] expressions)
{
return Expression.Call(null, method, expressions);
}
// Token: 0x060003A7 RID: 935 RVA: 0x00011034 File Offset: 0x0000F234
private static TRet Execute(this IQueryable source, MethodBase current)
{
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(current, new Type[] { typeof(TSource) }), new Expression[] { source.Expression }));
}
/// Applies an accumulator function over a sequence.
/// The final accumulator value.
/// A sequence to aggregate over.
/// An accumulator function to apply to each element.
/// The type of the elements of .
///
/// or is null.
///
/// contains no elements.
// Token: 0x060003A8 RID: 936 RVA: 0x0001107C File Offset: 0x0000F27C
public static TSource Aggregate(this IQueryable source, Expression> func)
{
Check.SourceAndFunc(source, func);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(func)
}));
}
/// Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.
/// The final accumulator value.
/// A sequence to aggregate over.
/// The initial accumulator value.
/// An accumulator function to invoke on each element.
/// The type of the elements of .
/// The type of the accumulator value.
///
/// or is null.
// Token: 0x060003A9 RID: 937 RVA: 0x000110D8 File Offset: 0x0000F2D8
public static TAccumulate Aggregate(this IQueryable source, TAccumulate seed, Expression> func)
{
Check.SourceAndFunc(source, func);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TAccumulate)
}), new Expression[]
{
source.Expression,
Expression.Constant(seed),
Expression.Quote(func)
}));
}
/// Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
/// The transformed final accumulator value.
/// A sequence to aggregate over.
/// The initial accumulator value.
/// An accumulator function to invoke on each element.
/// A function to transform the final accumulator value into the result value.
/// The type of the elements of .
/// The type of the accumulator value.
/// The type of the resulting value.
///
/// or or is null.
// Token: 0x060003AA RID: 938 RVA: 0x0001114C File Offset: 0x0000F34C
public static TResult Aggregate(this IQueryable source, TAccumulate seed, Expression> func, Expression> selector)
{
Check.SourceAndFuncAndSelector(source, func, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TAccumulate),
typeof(TResult)
}), new Expression[]
{
source.Expression,
Expression.Constant(seed),
Expression.Quote(func),
Expression.Quote(selector)
}));
}
/// Determines whether all the elements of a sequence satisfy a condition.
/// true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.
/// A sequence whose elements to test for a condition.
/// A function to test each element for a condition.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003AB RID: 939 RVA: 0x000111D8 File Offset: 0x0000F3D8
public static bool All(this IQueryable source, Expression> predicate)
{
Check.SourceAndPredicate(source, predicate);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(predicate)
}));
}
/// Determines whether a sequence contains any elements.
/// true if the source sequence contains any elements; otherwise, false.
/// A sequence to check for being empty.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003AC RID: 940 RVA: 0x00011234 File Offset: 0x0000F434
public static bool Any(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[] { source.Expression }));
}
/// Determines whether any element of a sequence satisfies a condition.
/// true if any elements in the source sequence pass the test in the specified predicate; otherwise, false.
/// A sequence whose elements to test for a condition.
/// A function to test each element for a condition.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003AD RID: 941 RVA: 0x00011284 File Offset: 0x0000F484
public static bool Any(this IQueryable source, Expression> predicate)
{
Check.SourceAndPredicate(source, predicate);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(predicate)
}));
}
/// Converts a generic to a generic .
/// An that represents the input sequence.
/// A sequence to convert.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003AE RID: 942 RVA: 0x000112E0 File Offset: 0x0000F4E0
public static IQueryable AsQueryable(this IEnumerable source)
{
if (source == null)
{
throw new ArgumentNullException("source");
}
IQueryable queryable = source as IQueryable;
if (queryable != null)
{
return queryable;
}
return new QueryableEnumerable(source);
}
/// Converts an to an .
/// An that represents the input sequence.
/// A sequence to convert.
///
/// does not implement for some .
///
/// is null.
// Token: 0x060003AF RID: 943 RVA: 0x00011314 File Offset: 0x0000F514
public static IQueryable AsQueryable(this IEnumerable source)
{
if (source == null)
{
throw new ArgumentNullException("source");
}
IQueryable queryable = source as IQueryable;
if (queryable != null)
{
return queryable;
}
Type type = source.GetType();
if (!type.IsGenericImplementationOf(typeof(IEnumerable<>)))
{
throw new ArgumentException("source is not IEnumerable<>");
}
return (IQueryable)Activator.CreateInstance(typeof(QueryableEnumerable<>).MakeGenericType(new Type[] { type.GetFirstGenericArgument() }), new object[] { source });
}
/// Computes the average of a sequence of values.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
///
/// is null.
///
/// contains no elements.
// Token: 0x060003B0 RID: 944 RVA: 0x0001139C File Offset: 0x0000F59C
public static double Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of nullable values.
/// The average of the sequence of values, or null if the source sequence is empty or contains only null values.
/// A sequence of nullable values to calculate the average of.
///
/// is null.
// Token: 0x060003B1 RID: 945 RVA: 0x000113D8 File Offset: 0x0000F5D8
public static double? Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of values.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
///
/// is null.
///
/// contains no elements.
// Token: 0x060003B2 RID: 946 RVA: 0x00011414 File Offset: 0x0000F614
public static double Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of nullable values.
/// The average of the sequence of values, or null if the source sequence is empty or contains only null values.
/// A sequence of nullable values to calculate the average of.
///
/// is null.
// Token: 0x060003B3 RID: 947 RVA: 0x00011450 File Offset: 0x0000F650
public static double? Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of values.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
///
/// is null.
///
/// contains no elements.
// Token: 0x060003B4 RID: 948 RVA: 0x0001148C File Offset: 0x0000F68C
public static float Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of nullable values.
/// The average of the sequence of values, or null if the source sequence is empty or contains only null values.
/// A sequence of nullable values to calculate the average of.
///
/// is null.
// Token: 0x060003B5 RID: 949 RVA: 0x000114C8 File Offset: 0x0000F6C8
public static float? Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of values.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
///
/// is null.
///
/// contains no elements.
// Token: 0x060003B6 RID: 950 RVA: 0x00011504 File Offset: 0x0000F704
public static double Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of nullable values.
/// The average of the sequence of values, or null if the source sequence is empty or contains only null values.
/// A sequence of nullable values to calculate the average of.
///
/// is null.
// Token: 0x060003B7 RID: 951 RVA: 0x00011540 File Offset: 0x0000F740
public static double? Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of values.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
///
/// is null.
///
/// contains no elements.
// Token: 0x060003B8 RID: 952 RVA: 0x0001157C File Offset: 0x0000F77C
public static decimal Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of nullable values.
/// The average of the sequence of values, or null if the source sequence is empty or contains only null values.
/// A sequence of nullable values to calculate the average of.
///
/// is null.
// Token: 0x060003B9 RID: 953 RVA: 0x000115B8 File Offset: 0x0000F7B8
public static decimal? Average(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), new Expression[] { source.Expression }));
}
/// Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
///
/// contains no elements.
// Token: 0x060003BA RID: 954 RVA: 0x000115F4 File Offset: 0x0000F7F4
public static double Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values, or null if the sequence is empty or contains only null values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003BB RID: 955 RVA: 0x00011650 File Offset: 0x0000F850
public static double? Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
///
/// contains no elements.
// Token: 0x060003BC RID: 956 RVA: 0x000116AC File Offset: 0x0000F8AC
public static double Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values, or null if the sequence is empty or contains only null values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003BD RID: 957 RVA: 0x00011708 File Offset: 0x0000F908
public static double? Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
///
/// contains no elements.
// Token: 0x060003BE RID: 958 RVA: 0x00011764 File Offset: 0x0000F964
public static float Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values, or null if the sequence is empty or contains only null values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003BF RID: 959 RVA: 0x000117C0 File Offset: 0x0000F9C0
public static float? Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
///
/// contains no elements.
// Token: 0x060003C0 RID: 960 RVA: 0x0001181C File Offset: 0x0000FA1C
public static double Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values, or null if the sequence is empty or contains only null values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003C1 RID: 961 RVA: 0x00011878 File Offset: 0x0000FA78
public static double? Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values.
/// A sequence of values that are used to calculate an average.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
///
/// contains no elements.
// Token: 0x060003C2 RID: 962 RVA: 0x000118D4 File Offset: 0x0000FAD4
public static decimal Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence.
/// The average of the sequence of values, or null if the sequence is empty or contains only null values.
/// A sequence of values to calculate the average of.
/// A projection function to apply to each element.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003C3 RID: 963 RVA: 0x00011930 File Offset: 0x0000FB30
public static decimal? Average(this IQueryable source, Expression> selector)
{
Check.SourceAndSelector(source, selector);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(selector)
}));
}
/// Converts the elements of an to the specified type.
/// An that contains each element of the source sequence converted to the specified type.
/// The that contains the elements to be converted.
/// The type to convert the elements of to.
///
/// is null.
/// An element in the sequence cannot be cast to type .
// Token: 0x060003C4 RID: 964 RVA: 0x0001198C File Offset: 0x0000FB8C
public static IQueryable Cast(this IQueryable source)
{
Check.Source(source);
return (IQueryable)source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TResult) }), new Expression[] { source.Expression }));
}
/// Concatenates two sequences.
/// An that contains the concatenated elements of the two input sequences.
/// The first sequence to concatenate.
/// The sequence to concatenate to the first sequence.
/// The type of the elements of the input sequences.
///
/// or is null.
// Token: 0x060003C5 RID: 965 RVA: 0x000119E0 File Offset: 0x0000FBE0
public static IQueryable Concat(this IQueryable source1, IEnumerable source2)
{
Check.Source1AndSource2(source1, source2);
return source1.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source1.Expression,
Expression.Constant(source2)
}));
}
/// Determines whether a sequence contains a specified element by using the default equality comparer.
/// true if the input sequence contains an element that has the specified value; otherwise, false.
/// An in which to locate .
/// The object to locate in the sequence.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003C6 RID: 966 RVA: 0x00011A3C File Offset: 0x0000FC3C
public static bool Contains(this IQueryable source, TSource item)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Constant(item)
}));
}
/// Determines whether a sequence contains a specified element by using a specified .
/// true if the input sequence contains an element that has the specified value; otherwise, false.
/// An in which to locate .
/// The object to locate in the sequence.
/// An to compare values.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003C7 RID: 967 RVA: 0x00011A9C File Offset: 0x0000FC9C
public static bool Contains(this IQueryable source, TSource item, IEqualityComparer comparer)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Constant(item),
Expression.Constant(comparer)
}));
}
/// Returns the number of elements in a sequence.
/// The number of elements in the input sequence.
/// The that contains the elements to be counted.
/// The type of the elements of .
///
/// is null.
/// The number of elements in is larger than .
// Token: 0x060003C8 RID: 968 RVA: 0x00011B04 File Offset: 0x0000FD04
public static int Count(this IQueryable source)
{
Check.Source(source);
return source.Execute(MethodBase.GetCurrentMethod());
}
/// Returns the number of elements in the specified sequence that satisfies a condition.
/// The number of elements in the sequence that satisfies the condition in the predicate function.
/// An that contains the elements to be counted.
/// A function to test each element for a condition.
/// The type of the elements of .
///
/// or is null.
/// The number of elements in is larger than .
// Token: 0x060003C9 RID: 969 RVA: 0x00011B18 File Offset: 0x0000FD18
public static int Count(this IQueryable source, Expression> predicate)
{
Check.SourceAndPredicate(source, predicate);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(predicate)
}));
}
/// Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.
/// An that contains default() if is empty; otherwise, .
/// The to return a default value for if empty.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003CA RID: 970 RVA: 0x00011B74 File Offset: 0x0000FD74
public static IQueryable DefaultIfEmpty(this IQueryable source)
{
Check.Source(source);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[] { source.Expression }));
}
/// Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.
/// An that contains if is empty; otherwise, .
/// The to return the specified value for if empty.
/// The value to return if the sequence is empty.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003CB RID: 971 RVA: 0x00011BC4 File Offset: 0x0000FDC4
public static IQueryable DefaultIfEmpty(this IQueryable source, TSource defaultValue)
{
Check.Source(source);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Constant(defaultValue)
}));
}
/// Returns distinct elements from a sequence by using the default equality comparer to compare values.
/// An that contains distinct elements from .
/// The to remove duplicates from.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003CC RID: 972 RVA: 0x00011C24 File Offset: 0x0000FE24
public static IQueryable Distinct(this IQueryable source)
{
Check.Source(source);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[] { source.Expression }));
}
/// Returns distinct elements from a sequence by using a specified to compare values.
/// An that contains distinct elements from .
/// The to remove duplicates from.
/// An to compare values.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003CD RID: 973 RVA: 0x00011C74 File Offset: 0x0000FE74
public static IQueryable Distinct(this IQueryable source, IEqualityComparer comparer)
{
Check.Source(source);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Constant(comparer)
}));
}
/// Returns the element at a specified index in a sequence.
/// The element at the specified position in .
/// An to return an element from.
/// The zero-based index of the element to retrieve.
/// The type of the elements of .
///
/// is null.
///
/// is less than zero.
// Token: 0x060003CE RID: 974 RVA: 0x00011CCC File Offset: 0x0000FECC
public static TSource ElementAt(this IQueryable source, int index)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Constant(index)
}));
}
/// Returns the element at a specified index in a sequence or a default value if the index is out of range.
/// default() if is outside the bounds of ; otherwise, the element at the specified position in .
/// An to return an element from.
/// The zero-based index of the element to retrieve.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003CF RID: 975 RVA: 0x00011D2C File Offset: 0x0000FF2C
public static TSource ElementAtOrDefault(this IQueryable source, int index)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Constant(index)
}));
}
/// Produces the set difference of two sequences by using the default equality comparer to compare values.
/// An that contains the set difference of the two sequences.
/// An whose elements that are not also in will be returned.
/// An whose elements that also occur in the first sequence will not appear in the returned sequence.
/// The type of the elements of the input sequences.
///
/// or is null.
// Token: 0x060003D0 RID: 976 RVA: 0x00011D8C File Offset: 0x0000FF8C
public static IQueryable Except(this IQueryable source1, IEnumerable source2)
{
Check.Source1AndSource2(source1, source2);
return source1.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source1.Expression,
Expression.Constant(source2)
}));
}
/// Produces the set difference of two sequences by using the specified to compare values.
/// An that contains the set difference of the two sequences.
/// An whose elements that are not also in will be returned.
/// An whose elements that also occur in the first sequence will not appear in the returned sequence.
/// An to compare values.
/// The type of the elements of the input sequences.
///
/// or is null.
// Token: 0x060003D1 RID: 977 RVA: 0x00011DE8 File Offset: 0x0000FFE8
public static IQueryable Except(this IQueryable source1, IEnumerable source2, IEqualityComparer comparer)
{
Check.Source1AndSource2(source1, source2);
return source1.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source1.Expression,
Expression.Constant(source2),
Expression.Constant(comparer)
}));
}
/// Returns the first element of a sequence.
/// The first element in .
/// The to return the first element of.
/// The type of the elements of .
///
/// is null.
/// The source sequence is empty.
// Token: 0x060003D2 RID: 978 RVA: 0x00011E4C File Offset: 0x0001004C
public static TSource First(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[] { source.Expression }));
}
/// Returns the first element of a sequence that satisfies a specified condition.
/// The first element in that passes the test in .
/// An to return an element from.
/// A function to test each element for a condition.
/// The type of the elements of .
///
/// or is null.
/// No element satisfies the condition in .-or-The source sequence is empty.
// Token: 0x060003D3 RID: 979 RVA: 0x00011E9C File Offset: 0x0001009C
public static TSource First(this IQueryable source, Expression> predicate)
{
Check.SourceAndPredicate(source, predicate);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(predicate)
}));
}
/// Returns the first element of a sequence, or a default value if the sequence contains no elements.
/// default() if is empty; otherwise, the first element in .
/// The to return the first element of.
/// The type of the elements of .
///
/// is null.
// Token: 0x060003D4 RID: 980 RVA: 0x00011EF8 File Offset: 0x000100F8
public static TSource FirstOrDefault(this IQueryable source)
{
Check.Source(source);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[] { source.Expression }));
}
/// Returns the first element of a sequence that satisfies a specified condition or a default value if no such element is found.
/// default() if is empty or if no element passes the test specified by ; otherwise, the first element in that passes the test specified by .
/// An to return an element from.
/// A function to test each element for a condition.
/// The type of the elements of .
///
/// or is null.
// Token: 0x060003D5 RID: 981 RVA: 0x00011F48 File Offset: 0x00010148
public static TSource FirstOrDefault(this IQueryable source, Expression> predicate)
{
Check.SourceAndPredicate(source, predicate);
return source.Provider.Execute(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source.Expression,
Expression.Quote(predicate)
}));
}
/// Groups the elements of a sequence according to a specified key selector function.
/// An IQueryable<IGrouping<TKey, TSource>> in C# or IQueryable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each object contains a sequence of objects and a key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// The type of the elements of .
/// The type of the key returned by the function represented in .
///
/// or is null.
// Token: 0x060003D6 RID: 982 RVA: 0x00011FA4 File Offset: 0x000101A4
public static IQueryable> GroupBy(this IQueryable source, Expression> keySelector)
{
Check.SourceAndKeySelector(source, keySelector);
return source.Provider.CreateQuery>(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector)
}));
}
/// Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.
/// An IQueryable<IGrouping<TKey, TSource>> in C# or IQueryable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each contains a sequence of objects and a key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// An to compare keys.
/// The type of the elements of .
/// The type of the key returned by the function represented in .
///
/// or or is null.
// Token: 0x060003D7 RID: 983 RVA: 0x0001200C File Offset: 0x0001020C
public static IQueryable> GroupBy(this IQueryable source, Expression> keySelector, IEqualityComparer comparer)
{
Check.SourceAndKeySelector(source, keySelector);
return source.Provider.CreateQuery>(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector),
Expression.Constant(comparer)
}));
}
/// Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.
/// An IQueryable<IGrouping<TKey, TElement>> in C# or IQueryable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each contains a sequence of objects of type and a key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// A function to map each source element to an element in an .
/// The type of the elements of .
/// The type of the key returned by the function represented in .
/// The type of the elements in each .
///
/// or or is null.
// Token: 0x060003D8 RID: 984 RVA: 0x0001207C File Offset: 0x0001027C
public static IQueryable> GroupBy(this IQueryable source, Expression> keySelector, Expression> elementSelector)
{
Check.SourceAndKeyElementSelectors(source, keySelector, elementSelector);
return source.Provider.CreateQuery>(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey),
typeof(TElement)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector),
Expression.Quote(elementSelector)
}));
}
/// Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
/// An T:System.Linq.IQueryable`1 that has a type argument of and where each element represents a projection over a group and its key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// A function to create a result value from each group.
/// The type of the elements of .
/// The type of the key returned by the function represented in .
/// The type of the result value returned by .
///
/// or or is null.
// Token: 0x060003D9 RID: 985 RVA: 0x000120FC File Offset: 0x000102FC
public static IQueryable GroupBy(this IQueryable source, Expression> keySelector, Expression, TResult>> resultSelector)
{
Check.SourceAndKeyResultSelectors(source, keySelector, resultSelector);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey),
typeof(TResult)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector),
Expression.Quote(resultSelector)
}));
}
/// Groups the elements of a sequence and projects the elements for each group by using a specified function. Key values are compared by using a specified comparer.
/// An IQueryable<IGrouping<TKey, TElement>> in C# or IQueryable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each contains a sequence of objects of type and a key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// A function to map each source element to an element in an .
/// An to compare keys.
/// The type of the elements of .
/// The type of the key returned by the function represented in .
/// The type of the elements in each .
///
/// or or or is null.
// Token: 0x060003DA RID: 986 RVA: 0x0001217C File Offset: 0x0001037C
public static IQueryable> GroupBy(this IQueryable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer)
{
Check.SourceAndKeyElementSelectors(source, keySelector, elementSelector);
return source.Provider.CreateQuery>(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey),
typeof(TElement)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector),
Expression.Quote(elementSelector),
Expression.Constant(comparer)
}));
}
/// Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function.
/// An T:System.Linq.IQueryable`1 that has a type argument of and where each element represents a projection over a group and its key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// A function to map each source element to an element in an .
/// A function to create a result value from each group.
/// The type of the elements of .
/// The type of the key returned by the function represented in .
/// The type of the elements in each .
/// The type of the result value returned by .
///
/// or or or is null.
// Token: 0x060003DB RID: 987 RVA: 0x00012204 File Offset: 0x00010404
public static IQueryable GroupBy(this IQueryable source, Expression> keySelector, Expression> elementSelector, Expression, TResult>> resultSelector)
{
Check.GroupBySelectors(source, keySelector, elementSelector, resultSelector);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey),
typeof(TElement),
typeof(TResult)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector),
Expression.Quote(elementSelector),
Expression.Quote(resultSelector)
}));
}
/// Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Keys are compared by using a specified comparer.
/// An T:System.Linq.IQueryable`1 that has a type argument of and where each element represents a projection over a group and its key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// A function to create a result value from each group.
/// An to compare keys.
/// The type of the elements of .
/// The type of the key returned by the function represented in .
/// The type of the result value returned by .
///
/// or or or is null.
// Token: 0x060003DC RID: 988 RVA: 0x00012298 File Offset: 0x00010498
public static IQueryable GroupBy(this IQueryable source, Expression> keySelector, Expression, TResult>> resultSelector, IEqualityComparer comparer)
{
Check.SourceAndKeyResultSelectors(source, keySelector, resultSelector);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey),
typeof(TResult)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector),
Expression.Quote(resultSelector),
Expression.Constant(comparer)
}));
}
/// Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Keys are compared by using a specified comparer and the elements of each group are projected by using a specified function.
/// An T:System.Linq.IQueryable`1 that has a type argument of and where each element represents a projection over a group and its key.
/// An whose elements to group.
/// A function to extract the key for each element.
/// A function to map each source element to an element in an .
/// A function to create a result value from each group.
/// An to compare keys.
/// The type of the elements of .
/// The type of the key returned by the function represented in .
/// The type of the elements in each .
/// The type of the result value returned by .
///
/// or or or or is null.
// Token: 0x060003DD RID: 989 RVA: 0x00012320 File Offset: 0x00010520
public static IQueryable GroupBy(this IQueryable source, Expression> keySelector, Expression> elementSelector, Expression, TResult>> resultSelector, IEqualityComparer comparer)
{
Check.GroupBySelectors(source, keySelector, elementSelector, resultSelector);
return source.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TSource),
typeof(TKey),
typeof(TElement),
typeof(TResult)
}), new Expression[]
{
source.Expression,
Expression.Quote(keySelector),
Expression.Quote(elementSelector),
Expression.Quote(resultSelector),
Expression.Constant(comparer)
}));
}
/// Correlates the elements of two sequences based on key equality and groups the results. The default equality comparer is used to compare keys.
/// An that contains elements of type obtained by performing a grouped join on two sequences.
/// The first sequence to join.
/// The sequence to join to the first sequence.
/// A function to extract the join key from each element of the first sequence.
/// A function to extract the join key from each element of the second sequence.
/// A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.
/// The type of the elements of the first sequence.
/// The type of the elements of the second sequence.
/// The type of the keys returned by the key selector functions.
/// The type of the result elements.
///
/// or or or or is null.
// Token: 0x060003DE RID: 990 RVA: 0x000123C0 File Offset: 0x000105C0
public static IQueryable GroupJoin(this IQueryable outer, IEnumerable inner, Expression> outerKeySelector, Expression> innerKeySelector, Expression, TResult>> resultSelector)
{
if (outer == null)
{
throw new ArgumentNullException("outer");
}
if (inner == null)
{
throw new ArgumentNullException("inner");
}
if (outerKeySelector == null)
{
throw new ArgumentNullException("outerKeySelector");
}
if (innerKeySelector == null)
{
throw new ArgumentNullException("innerKeySelector");
}
if (resultSelector == null)
{
throw new ArgumentNullException("resultSelector");
}
return outer.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TOuter),
typeof(TInner),
typeof(TKey),
typeof(TResult)
}), new Expression[]
{
outer.Expression,
Expression.Constant(inner),
Expression.Quote(outerKeySelector),
Expression.Quote(innerKeySelector),
Expression.Quote(resultSelector)
}));
}
/// Correlates the elements of two sequences based on key equality and groups the results. A specified is used to compare keys.
/// An that contains elements of type obtained by performing a grouped join on two sequences.
/// The first sequence to join.
/// The sequence to join to the first sequence.
/// A function to extract the join key from each element of the first sequence.
/// A function to extract the join key from each element of the second sequence.
/// A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.
/// A comparer to hash and compare keys.
/// The type of the elements of the first sequence.
/// The type of the elements of the second sequence.
/// The type of the keys returned by the key selector functions.
/// The type of the result elements.
///
/// or or or or is null.
// Token: 0x060003DF RID: 991 RVA: 0x000124AC File Offset: 0x000106AC
public static IQueryable GroupJoin(this IQueryable outer, IEnumerable inner, Expression> outerKeySelector, Expression> innerKeySelector, Expression, TResult>> resultSelector, IEqualityComparer comparer)
{
if (outer == null)
{
throw new ArgumentNullException("outer");
}
if (inner == null)
{
throw new ArgumentNullException("inner");
}
if (outerKeySelector == null)
{
throw new ArgumentNullException("outerKeySelector");
}
if (innerKeySelector == null)
{
throw new ArgumentNullException("innerKeySelector");
}
if (resultSelector == null)
{
throw new ArgumentNullException("resultSelector");
}
return outer.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TOuter),
typeof(TInner),
typeof(TKey),
typeof(TResult)
}), new Expression[]
{
outer.Expression,
Expression.Constant(inner),
Expression.Quote(outerKeySelector),
Expression.Quote(innerKeySelector),
Expression.Quote(resultSelector),
Expression.Constant(comparer)
}));
}
/// Produces the set intersection of two sequences by using the default equality comparer to compare values.
/// A sequence that contains the set intersection of the two sequences.
/// A sequence whose distinct elements that also appear in are returned.
/// A sequence whose distinct elements that also appear in the first sequence are returned.
/// The type of the elements of the input sequences.
///
/// or is null.
// Token: 0x060003E0 RID: 992 RVA: 0x000125A4 File Offset: 0x000107A4
public static IQueryable Intersect(this IQueryable source1, IEnumerable source2)
{
Check.Source1AndSource2(source1, source2);
return source1.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source1.Expression,
Expression.Constant(source2)
}));
}
/// Produces the set intersection of two sequences by using the specified to compare values.
/// An that contains the set intersection of the two sequences.
/// An whose distinct elements that also appear in are returned.
/// An whose distinct elements that also appear in the first sequence are returned.
/// An to compare values.
/// The type of the elements of the input sequences.
///
/// or is null.
// Token: 0x060003E1 RID: 993 RVA: 0x00012600 File Offset: 0x00010800
public static IQueryable Intersect(this IQueryable source1, IEnumerable source2, IEqualityComparer comparer)
{
Check.Source1AndSource2(source1, source2);
return source1.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[] { typeof(TSource) }), new Expression[]
{
source1.Expression,
Expression.Constant(source2),
Expression.Constant(comparer)
}));
}
/// Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.
/// An that has elements of type obtained by performing an inner join on two sequences.
/// The first sequence to join.
/// The sequence to join to the first sequence.
/// A function to extract the join key from each element of the first sequence.
/// A function to extract the join key from each element of the second sequence.
/// A function to create a result element from two matching elements.
/// The type of the elements of the first sequence.
/// The type of the elements of the second sequence.
/// The type of the keys returned by the key selector functions.
/// The type of the result elements.
///
/// or or or or is null.
// Token: 0x060003E2 RID: 994 RVA: 0x00012664 File Offset: 0x00010864
public static IQueryable Join(this IQueryable outer, IEnumerable inner, Expression> outerKeySelector, Expression> innerKeySelector, Expression> resultSelector)
{
Check.JoinSelectors(outer, inner, outerKeySelector, innerKeySelector, resultSelector);
return outer.Provider.CreateQuery(Queryable.StaticCall(Queryable.MakeGeneric(MethodBase.GetCurrentMethod(), new Type[]
{
typeof(TOuter),
typeof(TInner),
typeof(TKey),
typeof(TResult)
}), new Expression[]
{
outer.Expression,
Expression.Constant(inner),
Expression.Quote(outerKeySelector),
Expression.Quote(innerKeySelector),
Expression.Quote(resultSelector)
}));
}
/// Correlates the elements of two sequences based on matching keys. A specified is used to compare keys.
/// An that has elements of type obtained by performing an inner join on two sequences.
/// The first sequence to join.
/// The sequence to join to the first sequence.
/// A function to extract the join key from each element of the first sequence.
/// A function to extract the join key from each element of the second sequence.
/// A function to create a result element from two matching elements.
/// An to hash and compare keys.
/// The type of the elements of the first sequence.
/// The type of the elements of the second sequence.
/// The type of the keys returned by the key selector functions.
/// The type of the result elements.
///
/// or or or or is null.
// Token: 0x060003E3 RID: 995 RVA: 0x00012704 File Offset: 0x00010904
public static IQueryable Join(this IQueryable outer, IEnumerable inner, Expression