Share via


HpcLinqQueryable.LongCountAsQuery Method (IQueryable)

Creates a query that you can run later to get the number of records in a set of records as a 64-bit integer.

Namespace: Microsoft.Hpc.Linq
Assembly: Microsoft.Hpc.Linq (in Microsoft.Hpc.Linq.dll)

Usage

'Usage
Dim source As IQueryable(Of TSource)
Dim returnValue As IQueryable(Of Long)

returnValue = HpcLinqQueryable.LongCountAsQuery(source)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function LongCountAsQuery(Of TSource) ( _
    source As IQueryable(Of TSource) _
) As IQueryable(Of Long)
[ExtensionAttribute] 
public static IQueryable<long> LongCountAsQuery<TSource> (
    IQueryable<TSource> source
)
[ExtensionAttribute] 
public:
generic<typename TSource>
static IQueryable<long long>^ LongCountAsQuery (
    IQueryable<TSource>^ source
)
J# supports the use of generic APIs, but not the declaration of new ones.
JScript does not support generic types or methods.

GenericParameters

  • TSource
    The type of the records in the source parameter.

Parameters

Return Value

An IQueryable interface for the query.

Exceptions

Exception type Condition
ArgumentNullException

The specified source parameter is a null reference (Nothing in Visual Basic).

Remarks

Use this method if you want to perform the same query as the LongCount method, but want to delay running the query instead of generating results immediately.

Use the Submit method to run the query. Use the GetEnumerator method or the foreach statement of the C# language (For Each in Visual Basic) to get the results of the query. The enumerator contains a single Int64 element that indicates the number of records in the set of records. To get the number of records as an Int32 instead, use the CountAsQuery(Generic IQueryable) method.

To create a query that gets the number of records in the set of records that satisfy the condition for which a specified function tests as a 64-bit integer, use the LongCountAsQuery(Generic IQueryable,Generic Expression) form of the method.

In Visual Basic and C#, you can call this method as an instance method on any object of type IQueryable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

For more information about how the query runs and its behavior, see the Remarks section for the LongCount method.

Platform Note: This method was introduced in Windows HPC Server 2008 R2 with Service Pack 2 (SP2) and is not supported in previous versions.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP, Windows Vista, Windows 7, Windows 8, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

Target Platforms

Windows XP, Windows Vista, Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, with HPC Pack Client Utilities

See Also

Reference

HpcLinqQueryable Class
HpcLinqQueryable Members
Microsoft.Hpc.Linq Namespace
LongCount
LongCountAsQuery(Generic IQueryable,Generic Expression)
CountAsQuery(Generic IQueryable)

Build Date:

2013-04-22