Table of Contents

Method OfType

Namespace
MongoDB.Driver.Linq
Assembly
MongoDB.Driver.dll

OfType<TResult>(IMongoQueryable)

Filters the elements of an IMongoQueryable based on a specified type.

public static IMongoQueryable<TResult> OfType<TResult>(this IMongoQueryable source)

Parameters

source IMongoQueryable

An IMongoQueryable whose elements to filter.

Returns

IMongoQueryable<TResult>

A collection that contains the elements from source that have type TResult.

Type Parameters

TResult

The type to filter the elements of the sequence on.