ObjectQuery<T>.OfType<TResultType> Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Limits the query to only results of a specific type.
public:
generic <typename TResultType>
System::Data::Objects::ObjectQuery<TResultType> ^ OfType();
public System.Data.Objects.ObjectQuery<TResultType> OfType<TResultType> ();
member this.OfType : unit -> System.Data.Objects.ObjectQuery<'ResultType>
Public Function OfType(Of TResultType) () As ObjectQuery(Of TResultType)
- TResultType
The type of the ObjectResult<T> returned when the query is executed with the applied filter.
A new ObjectQuery<T> instance that is equivalent to the original instance with OFTYPE applied.
The type specified is not valid.
OfType is used to filter query results by a specific entity or complex type. This supports a conceptual model with object inheritance. For more information, see Entity Data Model: Inheritance.
The OfType method can only be applied to an ObjectQuery<T> of an entity type or complex type that is defined in the EDM.
Produkt | Versjoner |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET-tilbakemelding
.NET er et åpen kilde-prosjekt. Velg en kobling for å gi tilbakemelding: