DbExpressionBuilder.OfType(DbExpression, TypeUsage) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立一個新 DbOfTypeExpression ,產生由指定類型元素組成的集合。
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
參數
- argument
- DbExpression
A DbExpression 指定輸入集合。
- type
- TypeUsage
輸入集合元素必須包含在結果集合中的類型元資料。
傳回
一個新的 DbOfTypeExpression,包含指定的集合參數與型別,以及一個 ExpressionKind 的 OfType。
例外狀況
argument 或 type 為空值。
argument 沒有集合結果型別,或 type 與集合結果型別 argument的元素類型不在同一型態階層中。
備註
DbOfTypeExpression 要求 擁有 argument 一個集合結果型別,且該集合結果型別具有多型元素型別 type ,且該型別與該元素型別具有相同型態階層。