DbExpressionBuilder.TreatAs(DbExpression, TypeUsage) メソッド

定義

新しい 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

パラメーター

argument
DbExpression

インスタンスを指定する式。

treatType
TypeUsage

想定する型の型メタデータ。

戻り値

指定された引数と型を持つ新しい DbTreatExpression。

例外

argument または treatType が null です。

treatType が属する型階層が、argument の結果型が属する型階層と異なります。

注釈

DbTreatExpression では、 が argument ポリモーフィックな結果型を持ち、その treatType 結果の型と同じ型階層の型である必要があります。

適用対象