Udostępnij za pośrednictwem


DbExpressionBuilder.TreatAs(DbExpression, TypeUsage) Metoda

Definicja

Tworzy nowy adres DbTreatExpression.

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

Parametry

argument
DbExpression

Wyrażenie określające wystąpienie.

treatType
TypeUsage

Wpisz metadane dla typu traktuj jako.

Zwraca

Nowy dbTreatExpression z określonym argumentem i typem.

Wyjątki

argument lub treatType ma wartość null.

treatType nie znajduje się w hierarchii tego samego typu co typ argumentwyniku .

Uwagi

DbTreatExpression wymaga, aby argument miał typ wyniku polimorficznego i treatType jest to typ z tej samej hierarchii typów co ten typ wyniku.

Dotyczy