Share via


DataServiceProviderMethods.OfType<TSource, TResult> Method (IEnumerable<TSource>, ResourceType)

Filters the supplied query based on the specified ResourceType.

Namespace:  System.Data.Services.Providers
Assembly:  Microsoft.Data.Services (in Microsoft.Data.Services.dll)

Syntax

'Declaration
Public Shared Function OfType(Of TSource, TResult) ( _
    query As IEnumerable(Of TSource), _
    resourceType As ResourceType _
) As IEnumerable(Of TResult)
'Usage
Dim query As IEnumerable(Of TSource)
Dim resourceType As ResourceType 
Dim returnValue As IEnumerable(Of TResult)

returnValue = DataServiceProviderMethods.OfType(query, _
    resourceType)
public static IEnumerable<TResult> OfType<TSource, TResult>(
    IEnumerable<TSource> query,
    ResourceType resourceType
)
public:
generic<typename TSource, typename TResult>
static IEnumerable<TResult>^ OfType(
    IEnumerable<TSource>^ query, 
    ResourceType^ resourceType
)
static member OfType : 
        query:IEnumerable<'TSource> * 
        resourceType:ResourceType -> IEnumerable<'TResult> 
JScript does not support generic types and methods.

Type Parameters

  • TSource
    Type of the IQueryable<T> instance supplied as the query parameter.
  • TResult
    Type representing the resource type supplied as the resourceType parameter.

Parameters

Return Value

Type: System.Collections.Generic.IEnumerable<TResult>
Returns an IQueryable<T> instance filtered by the supplied resourceType.

See Also

Reference

DataServiceProviderMethods Class

OfType Overload

System.Data.Services.Providers Namespace