Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
8377 lines (7456 sloc) 723 KB
<Type Name="Queryable" FullName="System.Linq.Queryable">
<TypeSignature Language="C#" Value="public static class Queryable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit Queryable extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Linq.Queryable" />
<TypeSignature Language="VB.NET" Value="Public Module Queryable" />
<TypeSignature Language="C++ CLI" Value="public ref class Queryable abstract sealed" />
<TypeSignature Language="F#" Value="type Queryable = class" />
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides a set of <see langword="static" /> (<see langword="Shared" /> in Visual Basic) methods for querying data structures that implement <see cref="T:System.Linq.IQueryable`1" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The set of methods declared in the <xref:System.Linq.Queryable> class provides an implementation of the standard query operators for querying data sources that implement <xref:System.Linq.IQueryable%601>. The standard query operators are general purpose methods that follow the [!INCLUDE[vbteclinq](~/includes/vbteclinq-md.md)] pattern and enable you to express traversal, filter, and projection operations over data in any .NET-based programming language.
The majority of the methods in this class are defined as extension methods that extend the <xref:System.Linq.IQueryable%601> type. This means they can be called like an instance method on any object that implements <xref:System.Linq.IQueryable%601>. These methods that extend <xref:System.Linq.IQueryable%601> do not perform any querying directly. Instead, their functionality is to build an <xref:System.Linq.Expressions.Expression> object, which is an expression tree that represents the cumulative query. The methods then pass the new expression tree to either the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method or the <xref:System.Linq.IQueryProvider.CreateQuery%60%601%28System.Linq.Expressions.Expression%29> method of the input <xref:System.Linq.IQueryable%601>. The method that is called depends on whether the <xref:System.Linq.Queryable> method returns a singleton value, in which case <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> is called, or has enumerable results, in which case <xref:System.Linq.IQueryProvider.CreateQuery%60%601%28System.Linq.Expressions.Expression%29> is called.
The actual query execution on the target data is performed by a class that implements <xref:System.Linq.IQueryable%601>. The expectation of any <xref:System.Linq.IQueryable%601> implementation is that the result of executing an expression tree that was constructed by a <xref:System.Linq.Queryable> standard query operator method is equivalent to the result of calling the corresponding method in the <xref:System.Linq.Enumerable> class, if the data source were an <xref:System.Collections.Generic.IEnumerable%601>.
In addition to the standard query operator methods that operate on <xref:System.Linq.IQueryable%601> objects, this class also contains a method, <xref:System.Linq.Queryable.AsQueryable%2A>, which types <xref:System.Collections.IEnumerable> objects as <xref:System.Linq.IQueryable> objects.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/a73c4aec-5d15-4e98-b962-1274021ea93d">Language-Integrated Query (LINQ)</related>
<related type="Article" href="https://msdn.microsoft.com/library/24cda21e-8af8-4632-b519-c404a839b9b2">Standard Query Operators Overview</related>
<related type="Article" href="https://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b">Expression Trees</related>
<related type="Article" href="https://msdn.microsoft.com/library/73d13345-eece-471a-af40-4cc7a2f11655">LINQ to SQL</related>
</Docs>
<Members>
<Member MemberName="Aggregate&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static TSource Aggregate&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,TSource,TSource&gt;&gt; func);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!TSource Aggregate&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`3&lt;!!TSource, !!TSource, !!TSource&gt;&gt; func) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Aggregate``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``0,``0}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Aggregate(Of TSource) (source As IQueryable(Of TSource), func As Expression(Of Func(Of TSource, TSource, TSource))) As TSource" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static TSource Aggregate(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, TSource, TSource&gt; ^&gt; ^ func);" />
<MemberSignature Language="F#" Value="static member Aggregate : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, 'Source, 'Source&gt;&gt; -&gt; 'Source" Usage="System.Linq.Queryable.Aggregate (source, func)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>TSource</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="func" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,TSource,TSource&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence to aggregate over.</param>
<param name="func">An accumulator function to apply to each element.</param>
<summary>Applies an accumulator function over a sequence.</summary>
<returns>The final accumulator value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Aggregate%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2C%60%600%2C%60%600%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Aggregate%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2C%60%600%2C%60%600%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Aggregate%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2C%60%600%2C%60%600%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that the specified function, `func`, is applied to each value in the source sequence and the accumulated value is returned. The first value in `source` is used as the seed value for the accumulated value, which corresponds to the first parameter in `func`.
To simplify common aggregation operations, the set of standard query operators also includes two counting methods, <xref:System.Linq.Queryable.Count%2A> and <xref:System.Linq.Queryable.LongCount%2A>, and four numeric aggregation methods, namely <xref:System.Linq.Queryable.Max%2A>, <xref:System.Linq.Queryable.Min%2A>, <xref:System.Linq.Queryable.Sum%2A>, and <xref:System.Linq.Queryable.Average%2A>.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Aggregate%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2C%60%600%2C%60%600%7D%7D%29> to build a sentence from an array of strings.
[!code-csharp[System.Linq.Queryable#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#1)]
[!code-vb[System.Linq.Queryable#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="func" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Aggregate&lt;TSource,TAccumulate&gt;">
<MemberSignature Language="C#" Value="public static TAccumulate Aggregate&lt;TSource,TAccumulate&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, TAccumulate seed, System.Linq.Expressions.Expression&lt;Func&lt;TAccumulate,TSource,TAccumulate&gt;&gt; func);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!TAccumulate Aggregate&lt;TSource, TAccumulate&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, !!TAccumulate seed, class System.Linq.Expressions.Expression`1&lt;class System.Func`3&lt;!!TAccumulate, !!TSource, !!TAccumulate&gt;&gt; func) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Aggregate``2(System.Linq.IQueryable{``0},``1,System.Linq.Expressions.Expression{System.Func{``1,``0,``1}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Aggregate(Of TSource, TAccumulate) (source As IQueryable(Of TSource), seed As TAccumulate, func As Expression(Of Func(Of TAccumulate, TSource, TAccumulate))) As TAccumulate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource, typename TAccumulate&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static TAccumulate Aggregate(System::Linq::IQueryable&lt;TSource&gt; ^ source, TAccumulate seed, System::Linq::Expressions::Expression&lt;Func&lt;TAccumulate, TSource, TAccumulate&gt; ^&gt; ^ func);" />
<MemberSignature Language="F#" Value="static member Aggregate : System.Linq.IQueryable&lt;'Source&gt; * 'Accumulate * System.Linq.Expressions.Expression&lt;Func&lt;'Accumulate, 'Source, 'Accumulate&gt;&gt; -&gt; 'Accumulate" Usage="System.Linq.Queryable.Aggregate (source, seed, func)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>TAccumulate</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
<TypeParameter Name="TAccumulate" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="seed" Type="TAccumulate" />
<Parameter Name="func" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TAccumulate,TSource,TAccumulate&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<typeparam name="TAccumulate">The type of the accumulator value.</typeparam>
<param name="source">A sequence to aggregate over.</param>
<param name="seed">The initial accumulator value.</param>
<param name="func">An accumulator function to invoke on each element.</param>
<summary>Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.</summary>
<returns>The final accumulator value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Aggregate%60%602%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Aggregate%60%602%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Aggregate%60%602%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that the specified function, `func`, is applied to each value in the source sequence and the accumulated value is returned. The `seed` parameter is used as the seed value for the accumulated value, which corresponds to the first parameter in `func`.
To simplify common aggregation operations, the set of standard query operators also includes two counting methods, <xref:System.Linq.Queryable.Count%2A> and <xref:System.Linq.Queryable.LongCount%2A>, and four numeric aggregation methods, namely <xref:System.Linq.Queryable.Max%2A>, <xref:System.Linq.Queryable.Min%2A>, <xref:System.Linq.Queryable.Sum%2A>, and <xref:System.Linq.Queryable.Average%2A>.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Aggregate%60%602%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%29> to apply an accumulator function when a seed value is provided to the function.
[!code-csharp[System.Linq.Queryable#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#2)]
[!code-vb[System.Linq.Queryable#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="func" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Aggregate&lt;TSource,TAccumulate,TResult&gt;">
<MemberSignature Language="C#" Value="public static TResult Aggregate&lt;TSource,TAccumulate,TResult&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, TAccumulate seed, System.Linq.Expressions.Expression&lt;Func&lt;TAccumulate,TSource,TAccumulate&gt;&gt; func, System.Linq.Expressions.Expression&lt;Func&lt;TAccumulate,TResult&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!TResult Aggregate&lt;TSource, TAccumulate, TResult&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, !!TAccumulate seed, class System.Linq.Expressions.Expression`1&lt;class System.Func`3&lt;!!TAccumulate, !!TSource, !!TAccumulate&gt;&gt; func, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TAccumulate, !!TResult&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Aggregate``3(System.Linq.IQueryable{``0},``1,System.Linq.Expressions.Expression{System.Func{``1,``0,``1}},System.Linq.Expressions.Expression{System.Func{``1,``2}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Aggregate(Of TSource, TAccumulate, TResult) (source As IQueryable(Of TSource), seed As TAccumulate, func As Expression(Of Func(Of TAccumulate, TSource, TAccumulate)), selector As Expression(Of Func(Of TAccumulate, TResult))) As TResult" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource, typename TAccumulate, typename TResult&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static TResult Aggregate(System::Linq::IQueryable&lt;TSource&gt; ^ source, TAccumulate seed, System::Linq::Expressions::Expression&lt;Func&lt;TAccumulate, TSource, TAccumulate&gt; ^&gt; ^ func, System::Linq::Expressions::Expression&lt;Func&lt;TAccumulate, TResult&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Aggregate : System.Linq.IQueryable&lt;'Source&gt; * 'Accumulate * System.Linq.Expressions.Expression&lt;Func&lt;'Accumulate, 'Source, 'Accumulate&gt;&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Accumulate, 'Result&gt;&gt; -&gt; 'Result" Usage="System.Linq.Queryable.Aggregate (source, seed, func, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>TResult</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
<TypeParameter Name="TAccumulate" />
<TypeParameter Name="TResult" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="seed" Type="TAccumulate" />
<Parameter Name="func" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TAccumulate,TSource,TAccumulate&gt;&gt;" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TAccumulate,TResult&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<typeparam name="TAccumulate">The type of the accumulator value.</typeparam>
<typeparam name="TResult">The type of the resulting value.</typeparam>
<param name="source">A sequence to aggregate over.</param>
<param name="seed">The initial accumulator value.</param>
<param name="func">An accumulator function to invoke on each element.</param>
<param name="selector">A function to transform the final accumulator value into the result value.</param>
<summary>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.</summary>
<returns>The transformed final accumulator value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Aggregate%60%603%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%602%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Aggregate%60%603%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%602%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Aggregate%60%603%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%602%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that the specified function, `func`, is applied to each value in the source sequence and the accumulated value is returned. The `seed` parameter is used as the seed value for the accumulated value, which corresponds to the first parameter in `func`. The final accumulated value is passed to `selector` to obtain the result value.
To simplify common aggregation operations, the set of standard query operators also includes two counting methods, <xref:System.Linq.Queryable.Count%2A> and <xref:System.Linq.Queryable.LongCount%2A>, and four numeric aggregation methods, namely <xref:System.Linq.Queryable.Max%2A>, <xref:System.Linq.Queryable.Min%2A>, <xref:System.Linq.Queryable.Sum%2A>, and <xref:System.Linq.Queryable.Average%2A>.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Aggregate%60%603%28System.Linq.IQueryable%7B%60%600%7D%2C%60%601%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%600%2C%60%601%7D%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%601%2C%60%602%7D%7D%29> to apply an accumulator function and a result selector.
[!code-csharp[System.Linq.Queryable#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#3)]
[!code-vb[System.Linq.Queryable#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="func" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="All&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static bool All&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,bool&gt;&gt; predicate);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool All&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, bool&gt;&gt; predicate) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.All``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function All(Of TSource) (source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean))) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static bool All(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, bool&gt; ^&gt; ^ predicate);" />
<MemberSignature Language="F#" Value="static member All : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, bool&gt;&gt; -&gt; bool" Usage="System.Linq.Queryable.All (source, predicate)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="predicate" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Boolean&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence whose elements to test for a condition.</param>
<param name="predicate">A function to test each element for a condition.</param>
<summary>Determines whether all the elements of a sequence satisfy a condition.</summary>
<returns>
<see langword="true" /> if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.All%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.All%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.All%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> depends on the implementation of the `source` parameter's type. The expected behavior is that it determines if all the elements in `source` satisfy the condition in `predicate`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.All%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> to determine whether all the elements in a sequence satisfy a condition.
[!code-csharp[System.Linq.Queryable#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#4)]
[!code-vb[System.Linq.Queryable#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#4)]
The Boolean value that the <xref:System.Linq.Queryable.All%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> method returns is typically used in the predicate of a `where` clause (`Where` clause in Visual Basic) or a direct call to the <xref:System.Linq.Queryable.Where%2A> method. The following example demonstrates this use of the `All` method.
[!code-csharp[System.Linq.Queryable#134](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#134)]
[!code-vb[System.Linq.Queryable#134](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#134)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="predicate" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Any&lt;TSource&gt;">
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Determines whether any element of an <see cref="T:System.Linq.IQueryable`1" /> sequence exists or satisfies a condition.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Any&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static bool Any&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Any&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Any``1(System.Linq.IQueryable{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Any(Of TSource) (source As IQueryable(Of TSource)) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static bool Any(System::Linq::IQueryable&lt;TSource&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Any : System.Linq.IQueryable&lt;'Source&gt; -&gt; bool" Usage="System.Linq.Queryable.Any source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence to check for being empty.</param>
<summary>Determines whether a sequence contains any elements.</summary>
<returns>
<see langword="true" /> if the source sequence contains any elements; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it determines if `source` contains any elements.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> to determine whether a sequence contains any elements.
[!code-csharp[System.Linq.Queryable#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#5)]
[!code-vb[System.Linq.Queryable#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#5)]
The Boolean value that the <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> method returns is typically used in the predicate of a `where` clause (`Where` clause in Visual Basic) or a direct call to the <xref:System.Linq.Queryable.Where%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> method. The following example demonstrates this use of the `Any` method.
[!code-csharp[System.Linq.Queryable#135](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#135)]
[!code-vb[System.Linq.Queryable#135](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#135)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Any&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static bool Any&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,bool&gt;&gt; predicate);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Any&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, bool&gt;&gt; predicate) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Any``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Any(Of TSource) (source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean))) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static bool Any(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, bool&gt; ^&gt; ^ predicate);" />
<MemberSignature Language="F#" Value="static member Any : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, bool&gt;&gt; -&gt; bool" Usage="System.Linq.Queryable.Any (source, predicate)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="predicate" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Boolean&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence whose elements to test for a condition.</param>
<param name="predicate">A function to test each element for a condition.</param>
<summary>Determines whether any element of a sequence satisfies a condition.</summary>
<returns>
<see langword="true" /> if any elements in the source sequence pass the test in the specified predicate; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it determines if any of the elements of `source` satisfy the condition specified by `predicate`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Any%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> to determine whether any element in a sequence satisfies a condition.
[!code-csharp[System.Linq.Queryable#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#6)]
[!code-vb[System.Linq.Queryable#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#6)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="predicate" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Append&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TSource&gt; Append&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, TSource element);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TSource&gt; Append&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, !!TSource element) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Append``1(System.Linq.IQueryable{``0},``0)" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Append(Of TSource) (source As IQueryable(Of TSource), element As TSource) As IQueryable(Of TSource)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TSource&gt; ^ Append(System::Linq::IQueryable&lt;TSource&gt; ^ source, TSource element);" />
<MemberSignature Language="F#" Value="static member Append : System.Linq.IQueryable&lt;'Source&gt; * 'Source -&gt; System.Linq.IQueryable&lt;'Source&gt;" Usage="System.Linq.Queryable.Append (source, element)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TSource&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
<Parameter Name="element" Type="TSource" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<typeparam name="TSource">To be added.</typeparam>
<param name="source">To be added.</param>
<param name="element">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="AsQueryable">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable AsQueryable (this System.Collections.IEnumerable source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable AsQueryable(class System.Collections.IEnumerable source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.AsQueryable(System.Collections.IEnumerable)" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function AsQueryable (source As IEnumerable) As IQueryable" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable ^ AsQueryable(System::Collections::IEnumerable ^ source);" />
<MemberSignature Language="F#" Value="static member AsQueryable : System.Collections.IEnumerable -&gt; System.Linq.IQueryable" Usage="System.Linq.Queryable.AsQueryable source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Collections.IEnumerable" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence to convert.</param>
<summary>Converts an <see cref="T:System.Collections.IEnumerable" /> to an <see cref="T:System.Linq.IQueryable" />.</summary>
<returns>An <see cref="T:System.Linq.IQueryable" /> that represents the input sequence.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the type of `source` implements <xref:System.Linq.IQueryable%601>, <xref:System.Linq.Queryable.AsQueryable%28System.Collections.IEnumerable%29> returns it directly. Otherwise, it returns an <xref:System.Linq.IQueryable%601> that executes queries by calling the equivalent query operator methods in <xref:System.Linq.Enumerable> instead of those in <xref:System.Linq.Queryable>.
This method assumes that `source` implements <xref:System.Collections.Generic.IEnumerable%601> for some `T`. At runtime, the result is of type <xref:System.Linq.IQueryable%601> for the same `T`. This method is useful in dynamic scenarios when you do not statically know the type of `T`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="source" /> does not implement <see cref="T:System.Collections.Generic.IEnumerable`1" /> for some <paramref name="T" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="AsQueryable&lt;TElement&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TElement&gt; AsQueryable&lt;TElement&gt; (this System.Collections.Generic.IEnumerable&lt;TElement&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TElement&gt; AsQueryable&lt;TElement&gt;(class System.Collections.Generic.IEnumerable`1&lt;!!TElement&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.AsQueryable``1(System.Collections.Generic.IEnumerable{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function AsQueryable(Of TElement) (source As IEnumerable(Of TElement)) As IQueryable(Of TElement)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TElement&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TElement&gt; ^ AsQueryable(System::Collections::Generic::IEnumerable&lt;TElement&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member AsQueryable : seq&lt;'Element&gt; -&gt; System.Linq.IQueryable&lt;'Element&gt;" Usage="System.Linq.Queryable.AsQueryable source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TElement&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TElement" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Collections.Generic.IEnumerable&lt;TElement&gt;" RefType="this" />
</Parameters>
<Docs>
<typeparam name="TElement">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence to convert.</param>
<summary>Converts a generic <see cref="T:System.Collections.Generic.IEnumerable`1" /> to a generic <see cref="T:System.Linq.IQueryable`1" />.</summary>
<returns>An <see cref="T:System.Linq.IQueryable`1" /> that represents the input sequence.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the type of `source` implements <xref:System.Linq.IQueryable%601>, <xref:System.Linq.Queryable.AsQueryable%60%601%28System.Collections.Generic.IEnumerable%7B%60%600%7D%29> returns it directly. Otherwise, it returns an <xref:System.Linq.IQueryable%601> that executes queries by calling the equivalent query operator methods in <xref:System.Linq.Enumerable> instead of those in <xref:System.Linq.Queryable>.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.AsQueryable%60%601%28System.Collections.Generic.IEnumerable%7B%60%600%7D%29> to convert an <xref:System.Collections.Generic.IEnumerable%601> to an <xref:System.Linq.IQueryable%601>.
[!code-csharp[System.Linq.Queryable#125](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#125)]
[!code-vb[System.Linq.Queryable#125](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#125)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Average">
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Computes the average of a sequence of numeric values.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static decimal Average (this System.Linq.IQueryable&lt;decimal&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Decimal Average(class System.Linq.IQueryable`1&lt;valuetype System.Decimal&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Decimal})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Decimal)) As Decimal" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Decimal Average(System::Linq::IQueryable&lt;System::Decimal&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;decimal&gt; -&gt; decimal" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Decimal</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Decimal&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of <see cref="T:System.Decimal" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Decimal" /> values.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Decimal%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Decimal%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Decimal%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#8)]
[!code-vb[System.Linq.Queryable#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#8)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static double Average (this System.Linq.IQueryable&lt;double&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 Average(class System.Linq.IQueryable`1&lt;float64&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Double})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Double)) As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static double Average(System::Linq::IQueryable&lt;double&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;double&gt; -&gt; double" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Double&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of <see cref="T:System.Double" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Double" /> values.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Double%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Double%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Double%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#8)]
[!code-vb[System.Linq.Queryable#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#8)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static double Average (this System.Linq.IQueryable&lt;int&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 Average(class System.Linq.IQueryable`1&lt;int32&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Int32})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Integer)) As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static double Average(System::Linq::IQueryable&lt;int&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;int&gt; -&gt; double" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Int32&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of <see cref="T:System.Int32" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Int32" /> values.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> to calculate the average of a sequence of values.
[!code-csharp[System.Linq.Queryable#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#8)]
[!code-vb[System.Linq.Queryable#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#8)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static double Average (this System.Linq.IQueryable&lt;long&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 Average(class System.Linq.IQueryable`1&lt;int64&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Int64})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Long)) As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static double Average(System::Linq::IQueryable&lt;long&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;int64&gt; -&gt; double" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Int64&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of <see cref="T:System.Int64" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Int64" /> values.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int64%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int64%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int64%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#8)]
[!code-vb[System.Linq.Queryable#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#8)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static Nullable&lt;decimal&gt; Average (this System.Linq.IQueryable&lt;Nullable&lt;decimal&gt;&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;valuetype System.Decimal&gt; Average(class System.Linq.IQueryable`1&lt;valuetype System.Nullable`1&lt;valuetype System.Decimal&gt;&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Nullable{System.Decimal}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Nullable(Of Decimal))) As Nullable(Of Decimal)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;System::Decimal&gt; Average(System::Linq::IQueryable&lt;Nullable&lt;System::Decimal&gt;&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;Nullable&lt;decimal&gt;&gt; -&gt; Nullable&lt;decimal&gt;" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Decimal&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Nullable&lt;System.Decimal&gt;&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of nullable <see cref="T:System.Decimal" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Decimal" /> values.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the source sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Decimal%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Decimal%7D%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Decimal%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#12)]
[!code-vb[System.Linq.Queryable#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#12)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static Nullable&lt;double&gt; Average (this System.Linq.IQueryable&lt;Nullable&lt;double&gt;&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float64&gt; Average(class System.Linq.IQueryable`1&lt;valuetype System.Nullable`1&lt;float64&gt;&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Nullable{System.Double}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Nullable(Of Double))) As Nullable(Of Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;double&gt; Average(System::Linq::IQueryable&lt;Nullable&lt;double&gt;&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;Nullable&lt;double&gt;&gt; -&gt; Nullable&lt;double&gt;" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Double&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Nullable&lt;System.Double&gt;&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of nullable <see cref="T:System.Double" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Double" /> values.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the source sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Double%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Double%7D%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Double%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#12)]
[!code-vb[System.Linq.Queryable#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#12)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static Nullable&lt;double&gt; Average (this System.Linq.IQueryable&lt;Nullable&lt;int&gt;&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float64&gt; Average(class System.Linq.IQueryable`1&lt;valuetype System.Nullable`1&lt;int32&gt;&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Nullable{System.Int32}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Nullable(Of Integer))) As Nullable(Of Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;double&gt; Average(System::Linq::IQueryable&lt;Nullable&lt;int&gt;&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;Nullable&lt;int&gt;&gt; -&gt; Nullable&lt;double&gt;" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Double&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Nullable&lt;System.Int32&gt;&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of nullable <see cref="T:System.Int32" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Int32" /> values.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the source sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int32%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int32%7D%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int32%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#12)]
[!code-vb[System.Linq.Queryable#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#12)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static Nullable&lt;double&gt; Average (this System.Linq.IQueryable&lt;Nullable&lt;long&gt;&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float64&gt; Average(class System.Linq.IQueryable`1&lt;valuetype System.Nullable`1&lt;int64&gt;&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Nullable{System.Int64}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Nullable(Of Long))) As Nullable(Of Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;double&gt; Average(System::Linq::IQueryable&lt;Nullable&lt;long&gt;&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;Nullable&lt;int64&gt;&gt; -&gt; Nullable&lt;double&gt;" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Double&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Nullable&lt;System.Int64&gt;&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of nullable <see cref="T:System.Int64" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Int64" /> values.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the source sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> to calculate the average of a sequence of values.
[!code-csharp[System.Linq.Queryable#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#12)]
[!code-vb[System.Linq.Queryable#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#12)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static Nullable&lt;float&gt; Average (this System.Linq.IQueryable&lt;Nullable&lt;float&gt;&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float32&gt; Average(class System.Linq.IQueryable`1&lt;valuetype System.Nullable`1&lt;float32&gt;&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Nullable{System.Single}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Nullable(Of Single))) As Nullable(Of Single)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;float&gt; Average(System::Linq::IQueryable&lt;Nullable&lt;float&gt;&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;Nullable&lt;single&gt;&gt; -&gt; Nullable&lt;single&gt;" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Single&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Nullable&lt;System.Single&gt;&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of nullable <see cref="T:System.Single" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Single" /> values.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the source sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Single%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Single%7D%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Single%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Nullable%7BSystem.Int64%7D%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#12)]
[!code-vb[System.Linq.Queryable#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#12)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average">
<MemberSignature Language="C#" Value="public static float Average (this System.Linq.IQueryable&lt;float&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float32 Average(class System.Linq.IQueryable`1&lt;float32&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average(System.Linq.IQueryable{System.Single})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average (source As IQueryable(Of Single)) As Single" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static float Average(System::Linq::IQueryable&lt;float&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;single&gt; -&gt; single" Usage="System.Linq.Queryable.Average source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;System.Single&gt;" RefType="this" />
</Parameters>
<Docs>
<param name="source">A sequence of <see cref="T:System.Single" /> values to calculate the average of.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Single" /> values.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Single%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Single%7D%29> itself. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Single%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%28System.Linq.IQueryable%7BSystem.Int32%7D%29> to calculate the average of a sequence of values.
[!INCLUDE[sqo_diff_overload_example_elementtype](~/includes/sqo-diff-overload-example-elementtype-md.md)]
[!code-csharp[System.Linq.Queryable#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#8)]
[!code-vb[System.Linq.Queryable#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#8)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static decimal Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,decimal&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Decimal Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, valuetype System.Decimal&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Decimal}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Decimal))) As Decimal" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Decimal Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, System::Decimal&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, decimal&gt;&gt; -&gt; decimal" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Decimal</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Decimal&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values that are used to calculate an average.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Decimal" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Decimal%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Decimal%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Decimal%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static double Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,double&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, float64&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Double}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Double))) As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static double Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, double&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, double&gt;&gt; -&gt; double" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Double&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Double" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Double%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Double%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Double%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static double Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,int&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, int32&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Int32}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Integer))) As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static double Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, int&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, int&gt;&gt; -&gt; double" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Int32&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Int32" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static double Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,long&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, int64&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Int64}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Long))) As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static double Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, long&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, int64&gt;&gt; -&gt; double" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Int64&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Int64" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int64%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int64%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int64%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static Nullable&lt;decimal&gt; Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,Nullable&lt;decimal&gt;&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;valuetype System.Decimal&gt; Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, valuetype System.Nullable`1&lt;valuetype System.Decimal&gt;&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Nullable{System.Decimal}}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Decimal)))) As Nullable(Of Decimal)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;System::Decimal&gt; Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, Nullable&lt;System::Decimal&gt;&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, Nullable&lt;decimal&gt;&gt;&gt; -&gt; Nullable&lt;decimal&gt;" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Decimal&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Nullable&lt;System.Decimal&gt;&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Decimal" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the <paramref name="source" /> sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Decimal%7D%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Decimal%7D%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Decimal%7D%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static Nullable&lt;double&gt; Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,Nullable&lt;double&gt;&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float64&gt; Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, valuetype System.Nullable`1&lt;float64&gt;&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Nullable{System.Double}}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Double)))) As Nullable(Of Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;double&gt; Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, Nullable&lt;double&gt;&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, Nullable&lt;double&gt;&gt;&gt; -&gt; Nullable&lt;double&gt;" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Double&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Nullable&lt;System.Double&gt;&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Double" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the <paramref name="source" /> sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Double%7D%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Double%7D%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Double%7D%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static Nullable&lt;double&gt; Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,Nullable&lt;int&gt;&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float64&gt; Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, valuetype System.Nullable`1&lt;int32&gt;&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Nullable{System.Int32}}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Integer)))) As Nullable(Of Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;double&gt; Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, Nullable&lt;int&gt;&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, Nullable&lt;int&gt;&gt;&gt; -&gt; Nullable&lt;double&gt;" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Double&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Nullable&lt;System.Int32&gt;&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Int32" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the <paramref name="source" /> sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Int32%7D%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Int32%7D%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Int32%7D%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static Nullable&lt;double&gt; Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,Nullable&lt;long&gt;&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float64&gt; Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, valuetype System.Nullable`1&lt;int64&gt;&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Nullable{System.Int64}}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Long)))) As Nullable(Of Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;double&gt; Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, Nullable&lt;long&gt;&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, Nullable&lt;int64&gt;&gt;&gt; -&gt; Nullable&lt;double&gt;" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Double&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Nullable&lt;System.Int64&gt;&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Int64" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the <paramref name="source" /> sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Int64%7D%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Int64%7D%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Int64%7D%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static Nullable&lt;float&gt; Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,Nullable&lt;float&gt;&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1&lt;float32&gt; Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, valuetype System.Nullable`1&lt;float32&gt;&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Nullable{System.Single}}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Nullable(Of Single)))) As Nullable(Of Single)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static Nullable&lt;float&gt; Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, Nullable&lt;float&gt;&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, Nullable&lt;single&gt;&gt;&gt; -&gt; Nullable&lt;single&gt;" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Single&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Nullable&lt;System.Single&gt;&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of nullable <see cref="T:System.Single" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values, or <see langword="null" /> if the <paramref name="source" /> sequence is empty or contains only <see langword="null" /> values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Single%7D%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Single%7D%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Nullable%7BSystem.Single%7D%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Average&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static float Average&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,float&gt;&gt; selector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float32 Average&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, float32&gt;&gt; selector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Average``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Single}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Average(Of TSource) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Single))) As Single" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static float Average(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, float&gt; ^&gt; ^ selector);" />
<MemberSignature Language="F#" Value="static member Average : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, single&gt;&gt; -&gt; single" Usage="System.Linq.Queryable.Average (source, selector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="selector" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Single&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">A sequence of values to calculate the average of.</param>
<param name="selector">A projection function to apply to each element.</param>
<summary>Computes the average of a sequence of <see cref="T:System.Single" /> values that is obtained by invoking a projection function on each element of the input sequence.</summary>
<returns>The average of the sequence of values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Single%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Single%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Single%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it calculates the average of the values in `source` after invoking `selector` on each value.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Average%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Int32%7D%7D%29> to calculate the average <xref:System.String> length in a sequence of values of type <xref:System.String>.
[!INCLUDE[sqo_diff_overload_example_func](~/includes/sqo-diff-overload-example-func-md.md)]
[!code-csharp[System.Linq.Queryable#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#18)]
[!code-vb[System.Linq.Queryable#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#18)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="selector" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="source" /> contains no elements.</exception>
</Docs>
</Member>
<Member MemberName="Cast&lt;TResult&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TResult&gt; Cast&lt;TResult&gt; (this System.Linq.IQueryable source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TResult&gt; Cast&lt;TResult&gt;(class System.Linq.IQueryable source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Cast``1(System.Linq.IQueryable)" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Cast(Of TResult) (source As IQueryable) As IQueryable(Of TResult)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TResult&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TResult&gt; ^ Cast(System::Linq::IQueryable ^ source);" />
<MemberSignature Language="F#" Value="static member Cast : System.Linq.IQueryable -&gt; System.Linq.IQueryable&lt;'Result&gt;" Usage="System.Linq.Queryable.Cast source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TResult&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TResult" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable" RefType="this" />
</Parameters>
<Docs>
<typeparam name="TResult">The type to convert the elements of <paramref name="source" /> to.</typeparam>
<param name="source">The <see cref="T:System.Linq.IQueryable" /> that contains the elements to be converted.</param>
<summary>Converts the elements of an <see cref="T:System.Linq.IQueryable" /> to the specified type.</summary>
<returns>An <see cref="T:System.Linq.IQueryable`1" /> that contains each element of the source sequence converted to the specified type.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Cast%60%601%28System.Linq.IQueryable%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Cast%60%601%28System.Linq.IQueryable%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.CreateQuery%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Cast%60%601%28System.Linq.IQueryable%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it converts the values in `source` to type `TResult`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Cast%60%601%28System.Linq.IQueryable%29> to convert objects in a sequence to type <xref:System.String>.
[!code-csharp[System.Linq.Queryable#19](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#19)]
[!code-vb[System.Linq.Queryable#19](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#19)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidCastException">An element in the sequence cannot be cast to type <paramref name="TResult" />.</exception>
</Docs>
</Member>
<Member MemberName="Concat&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TSource&gt; Concat&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source1, System.Collections.Generic.IEnumerable&lt;TSource&gt; source2);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TSource&gt; Concat&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source1, class System.Collections.Generic.IEnumerable`1&lt;!!TSource&gt; source2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Concat``1(System.Linq.IQueryable{``0},System.Collections.Generic.IEnumerable{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Concat(Of TSource) (source1 As IQueryable(Of TSource), source2 As IEnumerable(Of TSource)) As IQueryable(Of TSource)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TSource&gt; ^ Concat(System::Linq::IQueryable&lt;TSource&gt; ^ source1, System::Collections::Generic::IEnumerable&lt;TSource&gt; ^ source2);" />
<MemberSignature Language="F#" Value="static member Concat : System.Linq.IQueryable&lt;'Source&gt; * seq&lt;'Source&gt; -&gt; System.Linq.IQueryable&lt;'Source&gt;" Usage="System.Linq.Queryable.Concat (source1, source2)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TSource&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source1" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="source2" Type="System.Collections.Generic.IEnumerable&lt;TSource&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of the input sequences.</typeparam>
<param name="source1">The first sequence to concatenate.</param>
<param name="source2">The sequence to concatenate to the first sequence.</param>
<summary>Concatenates two sequences.</summary>
<returns>An <see cref="T:System.Linq.IQueryable`1" /> that contains the concatenated elements of the two input sequences.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Concat%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Collections.Generic.IEnumerable%7B%60%600%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Concat%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Collections.Generic.IEnumerable%7B%60%600%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.CreateQuery%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source1` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Concat%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Collections.Generic.IEnumerable%7B%60%600%7D%29> depends on the implementation of the type of the `source1` parameter. The expected behavior is that the elements in `source2` are concatenated to those of `source1` to create a new sequence.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Concat%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Collections.Generic.IEnumerable%7B%60%600%7D%29> to concatenate two sequences.
[!code-csharp[System.Linq.Queryable#20](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#20)]
[!code-vb[System.Linq.Queryable#20](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#20)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source1" /> or <paramref name="source2" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Contains&lt;TSource&gt;">
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Determines whether an <see cref="T:System.Linq.IQueryable`1" /> contains a specified element.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Contains&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static bool Contains&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, TSource item);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Contains&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, !!TSource item) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Contains``1(System.Linq.IQueryable{``0},``0)" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Contains(Of TSource) (source As IQueryable(Of TSource), item As TSource) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static bool Contains(System::Linq::IQueryable&lt;TSource&gt; ^ source, TSource item);" />
<MemberSignature Language="F#" Value="static member Contains : System.Linq.IQueryable&lt;'Source&gt; * 'Source -&gt; bool" Usage="System.Linq.Queryable.Contains (source, item)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="item" Type="TSource" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">An <see cref="T:System.Linq.IQueryable`1" /> in which to locate <paramref name="item" />.</param>
<param name="item">The object to locate in the sequence.</param>
<summary>Determines whether a sequence contains a specified element by using the default equality comparer.</summary>
<returns>
<see langword="true" /> if the input sequence contains an element that has the specified value; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Contains%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Contains%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Contains%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it determines if `source` contains `item`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Contains%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> to determine whether a sequence contains a specific element.
[!code-csharp[System.Linq.Queryable#21](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#21)]
[!code-vb[System.Linq.Queryable#21](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#21)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Contains&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static bool Contains&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, TSource item, System.Collections.Generic.IEqualityComparer&lt;TSource&gt; comparer);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Contains&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, !!TSource item, class System.Collections.Generic.IEqualityComparer`1&lt;!!TSource&gt; comparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Contains``1(System.Linq.IQueryable{``0},``0,System.Collections.Generic.IEqualityComparer{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Contains(Of TSource) (source As IQueryable(Of TSource), item As TSource, comparer As IEqualityComparer(Of TSource)) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static bool Contains(System::Linq::IQueryable&lt;TSource&gt; ^ source, TSource item, System::Collections::Generic::IEqualityComparer&lt;TSource&gt; ^ comparer);" />
<MemberSignature Language="F#" Value="static member Contains : System.Linq.IQueryable&lt;'Source&gt; * 'Source * System.Collections.Generic.IEqualityComparer&lt;'Source&gt; -&gt; bool" Usage="System.Linq.Queryable.Contains (source, item, comparer)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="item" Type="TSource" />
<Parameter Name="comparer" Type="System.Collections.Generic.IEqualityComparer&lt;TSource&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">An <see cref="T:System.Linq.IQueryable`1" /> in which to locate <paramref name="item" />.</param>
<param name="item">The object to locate in the sequence.</param>
<param name="comparer">An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> to compare values.</param>
<summary>Determines whether a sequence contains a specified element by using a specified <see cref="T:System.Collections.Generic.IEqualityComparer`1" />.</summary>
<returns>
<see langword="true" /> if the input sequence contains an element that has the specified value; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Contains%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%2CSystem.Collections.Generic.IEqualityComparer%7B%60%600%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Contains%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%2CSystem.Collections.Generic.IEqualityComparer%7B%60%600%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Contains%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%2CSystem.Collections.Generic.IEqualityComparer%7B%60%600%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it determines if `source` contains `item` by using `comparer` to compare values.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Count&lt;TSource&gt;">
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Returns the number of elements in a sequence.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Count&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static int Count&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 Count&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Count``1(System.Linq.IQueryable{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Count(Of TSource) (source As IQueryable(Of TSource)) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static int Count(System::Linq::IQueryable&lt;TSource&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Count : System.Linq.IQueryable&lt;'Source&gt; -&gt; int" Usage="System.Linq.Queryable.Count source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">The <see cref="T:System.Linq.IQueryable`1" /> that contains the elements to be counted.</param>
<summary>Returns the number of elements in a sequence.</summary>
<returns>The number of elements in the input sequence.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it counts the number of items in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> to count the elements in a sequence.
[!code-csharp[System.Linq.Queryable#22](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#22)]
[!code-vb[System.Linq.Queryable#22](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#22)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
<exception cref="T:System.OverflowException">The number of elements in <paramref name="source" /> is larger than <see cref="F:System.Int32.MaxValue" />.</exception>
</Docs>
</Member>
<Member MemberName="Count&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static int Count&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Linq.Expressions.Expression&lt;Func&lt;TSource,bool&gt;&gt; predicate);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 Count&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, bool&gt;&gt; predicate) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Count``1(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Count(Of TSource) (source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean))) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static int Count(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Linq::Expressions::Expression&lt;Func&lt;TSource, bool&gt; ^&gt; ^ predicate);" />
<MemberSignature Language="F#" Value="static member Count : System.Linq.IQueryable&lt;'Source&gt; * System.Linq.Expressions.Expression&lt;Func&lt;'Source, bool&gt;&gt; -&gt; int" Usage="System.Linq.Queryable.Count (source, predicate)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="predicate" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Boolean&gt;&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">An <see cref="T:System.Linq.IQueryable`1" /> that contains the elements to be counted.</param>
<param name="predicate">A function to test each element for a condition.</param>
<summary>Returns the number of elements in the specified sequence that satisfies a condition.</summary>
<returns>The number of elements in the sequence that satisfies the condition in the predicate function.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method has at least one parameter of type <xref:System.Linq.Expressions.Expression%601> whose type argument is one of the <xref:System.Func%602> types. For these parameters, you can pass in a lambda expression and it will be compiled to an <xref:System.Linq.Expressions.Expression%601>.
The <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it counts the number of items in `source` that satisfy the condition specified by `predicate`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Count%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D%29> to count the elements in a sequence that satisfy a condition.
[!code-csharp[System.Linq.Queryable#23](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#23)]
[!code-vb[System.Linq.Queryable#23](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#23)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="predicate" /> is <see langword="null" />.</exception>
<exception cref="T:System.OverflowException">The number of elements in <paramref name="source" /> is larger than <see cref="F:System.Int32.MaxValue" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="DefaultIfEmpty&lt;TSource&gt;">
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Returns the elements in a sequence or a default valued singleton collection if the sequence is empty.</summary>
</Docs>
</MemberGroup>
<Member MemberName="DefaultIfEmpty&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TSource&gt; DefaultIfEmpty&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TSource&gt; DefaultIfEmpty&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.DefaultIfEmpty``1(System.Linq.IQueryable{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function DefaultIfEmpty(Of TSource) (source As IQueryable(Of TSource)) As IQueryable(Of TSource)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TSource&gt; ^ DefaultIfEmpty(System::Linq::IQueryable&lt;TSource&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member DefaultIfEmpty : System.Linq.IQueryable&lt;'Source&gt; -&gt; System.Linq.IQueryable&lt;'Source&gt;" Usage="System.Linq.Queryable.DefaultIfEmpty source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TSource&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">The <see cref="T:System.Linq.IQueryable`1" /> to return a default value for if empty.</param>
<summary>Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.</summary>
<returns>An <see cref="T:System.Linq.IQueryable`1" /> that contains <see langword="default" />(<paramref name="TSource" />) if <paramref name="source" /> is empty; otherwise, <paramref name="source" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.CreateQuery%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it returns `source` if it is not empty. Otherwise, it returns an <xref:System.Linq.IQueryable%601> that contains `default(TSource)`.
## Examples
The following code examples demonstrate how to use <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> to provide a default value in case the source sequence is empty.
[!code-csharp[System.Linq.Queryable#24](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#24)]
[!code-vb[System.Linq.Queryable#24](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#24)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="DefaultIfEmpty&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TSource&gt; DefaultIfEmpty&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, TSource defaultValue);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TSource&gt; DefaultIfEmpty&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, !!TSource defaultValue) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.DefaultIfEmpty``1(System.Linq.IQueryable{``0},``0)" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function DefaultIfEmpty(Of TSource) (source As IQueryable(Of TSource), defaultValue As TSource) As IQueryable(Of TSource)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TSource&gt; ^ DefaultIfEmpty(System::Linq::IQueryable&lt;TSource&gt; ^ source, TSource defaultValue);" />
<MemberSignature Language="F#" Value="static member DefaultIfEmpty : System.Linq.IQueryable&lt;'Source&gt; * 'Source -&gt; System.Linq.IQueryable&lt;'Source&gt;" Usage="System.Linq.Queryable.DefaultIfEmpty (source, defaultValue)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TSource&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="defaultValue" Type="TSource" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">The <see cref="T:System.Linq.IQueryable`1" /> to return the specified value for if empty.</param>
<param name="defaultValue">The value to return if the sequence is empty.</param>
<summary>Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.</summary>
<returns>An <see cref="T:System.Linq.IQueryable`1" /> that contains <paramref name="defaultValue" /> if <paramref name="source" /> is empty; otherwise, <paramref name="source" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.CreateQuery%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it returns `source` if it is not empty. Otherwise, it returns an <xref:System.Linq.IQueryable%601> that contains `defaultValue`.
## Examples
The following code example shows a situation in which it is useful to call <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> in a [!INCLUDE[vbteclinq](~/includes/vbteclinq-md.md)] query. A default value is passed to <xref:System.Linq.Queryable.DefaultIfEmpty%60%601%28System.Linq.IQueryable%7B%60%600%7D%2C%60%600%29> in this example.
[!code-csharp[System.Linq.Queryable#25](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#25)]
[!code-vb[System.Linq.Queryable#25](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#25)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Distinct&lt;TSource&gt;">
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Returns distinct elements from a sequence.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Distinct&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TSource&gt; Distinct&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TSource&gt; Distinct&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Distinct``1(System.Linq.IQueryable{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Distinct(Of TSource) (source As IQueryable(Of TSource)) As IQueryable(Of TSource)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TSource&gt; ^ Distinct(System::Linq::IQueryable&lt;TSource&gt; ^ source);" />
<MemberSignature Language="F#" Value="static member Distinct : System.Linq.IQueryable&lt;'Source&gt; -&gt; System.Linq.IQueryable&lt;'Source&gt;" Usage="System.Linq.Queryable.Distinct source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TSource&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">The <see cref="T:System.Linq.IQueryable`1" /> to remove duplicates from.</param>
<summary>Returns distinct elements from a sequence by using the default equality comparer to compare values.</summary>
<returns>An <see cref="T:System.Linq.IQueryable`1" /> that contains distinct elements from <paramref name="source" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Distinct%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Distinct%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.CreateQuery%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Distinct%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it returns an unordered sequence of the unique items in `source`.
## Examples
The following code example demonstrates how to use <xref:System.Linq.Queryable.Distinct%60%601%28System.Linq.IQueryable%7B%60%600%7D%29> to return distinct elements from a sequence.
[!code-csharp[System.Linq.Queryable#27](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Linq.Queryable/CS/queryable.cs#27)]
[!code-vb[System.Linq.Queryable#27](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Queryable/VB/queryable.vb#27)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Distinct&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static System.Linq.IQueryable&lt;TSource&gt; Distinct&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, System.Collections.Generic.IEqualityComparer&lt;TSource&gt; comparer);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Linq.IQueryable`1&lt;!!TSource&gt; Distinct&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, class System.Collections.Generic.IEqualityComparer`1&lt;!!TSource&gt; comparer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.Distinct``1(System.Linq.IQueryable{``0},System.Collections.Generic.IEqualityComparer{``0})" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function Distinct(Of TSource) (source As IQueryable(Of TSource), comparer As IEqualityComparer(Of TSource)) As IQueryable(Of TSource)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static System::Linq::IQueryable&lt;TSource&gt; ^ Distinct(System::Linq::IQueryable&lt;TSource&gt; ^ source, System::Collections::Generic::IEqualityComparer&lt;TSource&gt; ^ comparer);" />
<MemberSignature Language="F#" Value="static member Distinct : System.Linq.IQueryable&lt;'Source&gt; * System.Collections.Generic.IEqualityComparer&lt;'Source&gt; -&gt; System.Linq.IQueryable&lt;'Source&gt;" Usage="System.Linq.Queryable.Distinct (source, comparer)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Linq.IQueryable&lt;TSource&gt;</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="comparer" Type="System.Collections.Generic.IEqualityComparer&lt;TSource&gt;" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">The <see cref="T:System.Linq.IQueryable`1" /> to remove duplicates from.</param>
<param name="comparer">An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> to compare values.</param>
<summary>Returns distinct elements from a sequence by using a specified <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> to compare values.</summary>
<returns>An <see cref="T:System.Linq.IQueryable`1" /> that contains distinct elements from <paramref name="source" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.Distinct%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Collections.Generic.IEqualityComparer%7B%60%600%7D%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.Distinct%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Collections.Generic.IEqualityComparer%7B%60%600%7D%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.CreateQuery%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.Distinct%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Collections.Generic.IEqualityComparer%7B%60%600%7D%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it returns an unordered sequence of the unique items in `source` by using `comparer` to compare values.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="source" /> or <paramref name="comparer" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="ElementAt&lt;TSource&gt;">
<MemberSignature Language="C#" Value="public static TSource ElementAt&lt;TSource&gt; (this System.Linq.IQueryable&lt;TSource&gt; source, int index);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!TSource ElementAt&lt;TSource&gt;(class System.Linq.IQueryable`1&lt;!!TSource&gt; source, int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Linq.Queryable.ElementAt``1(System.Linq.IQueryable{``0},System.Int32)" />
<MemberSignature Language="VB.NET" Value="&lt;Extension()&gt;&#xA;Public Function ElementAt(Of TSource) (source As IQueryable(Of TSource), index As Integer) As TSource" />
<MemberSignature Language="C++ CLI" Value="public:&#xA;generic &lt;typename TSource&gt;&#xA;[System::Runtime::CompilerServices::Extension]&#xA; static TSource ElementAt(System::Linq::IQueryable&lt;TSource&gt; ^ source, int index);" />
<MemberSignature Language="F#" Value="static member ElementAt : System.Linq.IQueryable&lt;'Source&gt; * int -&gt; 'Source" Usage="System.Linq.Queryable.ElementAt (source, index)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Linq.Queryable</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Core</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>TSource</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TSource" />
</TypeParameters>
<Parameters>
<Parameter Name="source" Type="System.Linq.IQueryable&lt;TSource&gt;" RefType="this" />
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
<param name="source">An <see cref="T:System.Linq.IQueryable`1" /> to return an element from.</param>
<param name="index">The zero-based index of the element to retrieve.</param>
<summary>Returns the element at a specified index in a sequence.</summary>
<returns>The element at the specified position in <paramref name="source" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Linq.Queryable.ElementAt%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Int32%29> method generates a <xref:System.Linq.Expressions.MethodCallExpression> that represents calling <xref:System.Linq.Queryable.ElementAt%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Int32%29> itself as a constructed generic method. It then passes the <xref:System.Linq.Expressions.MethodCallExpression> to the <xref:System.Linq.IQueryProvider.Execute%60%601%28System.Linq.Expressions.Expression%29> method of the <xref:System.Linq.IQueryProvider> represented by the <xref:System.Linq.IQueryable.Provider%2A> property of the `source` parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling <xref:System.Linq.Queryable.ElementAt%60%601%28System.Linq.IQueryable%7B%60%600%7D%2CSystem.Int32%29> depends on the implementation of the type of the `source` parameter. The expected behavior is that it returns the item at position `index` in `source`.