ObjectQuery<T>.OfType<TResultType> Method

Definition

Limits the query to only results of a specific type.

public System.Data.Entity.Core.Objects.ObjectQuery<TResultType> OfType<TResultType> ();
member this.OfType : unit -> System.Data.Entity.Core.Objects.ObjectQuery<'ResultType>
Public Function OfType(Of TResultType) () As ObjectQuery(Of TResultType)

Type Parameters

TResultType

The type of the ObjectResult<T> returned when the query is executed with the applied filter.

Returns

ObjectQuery<TResultType>

A new ObjectQuery<T> instance that is equivalent to the original instance with OFTYPE applied.

Exceptions

The type specified is not valid.

Applies to