DbExpressionBuilder.OfType(DbExpression, TypeUsage) Metoda

Definicja

Tworzy nowy DbOfTypeExpression zestaw, który tworzy zestaw składający się z elementów danego zestawu danych wejściowych, które są określonego typu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Data::Common::CommandTrees::DbOfTypeExpression ^ OfType(System::Data::Common::CommandTrees::DbExpression ^ argument, System::Data::Metadata::Edm::TypeUsage ^ type);
public static System.Data.Common.CommandTrees.DbOfTypeExpression OfType(this System.Data.Common.CommandTrees.DbExpression argument, System.Data.Metadata.Edm.TypeUsage type);
static member OfType : System.Data.Common.CommandTrees.DbExpression * System.Data.Metadata.Edm.TypeUsage -> System.Data.Common.CommandTrees.DbOfTypeExpression
<Extension()>
Public Function OfType (argument As DbExpression, type As TypeUsage) As DbOfTypeExpression

Parametry

argument
DbExpression

Element DbExpression określający zestaw danych wejściowych.

type
TypeUsage

Wpisz metadane dla typu, który musi zawierać elementy zestawu danych wejściowych w zestawie wynikowym.

Zwraca

Nowy dbOfTypeExpression z określonym ustawionym argumentem i typem oraz wyrażeniem ExpressionKind wartości OfType.

Wyjątki

argument lub type ma wartość null.

argument nie ma typu wyników kolekcji lub type nie jest typem w hierarchii tego samego typu, co typ elementu typu wyniku argumentkolekcji .

Uwagi

DbOfTypeExpression wymaga, aby argument typ wyniku kolekcji miał typ elementu polimorficznego i type jest to typ z tej samej hierarchii typów co ten typ elementu.

Dotyczy