DbExpressionBuilder.OfTypeOnly(DbExpression, TypeUsage) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立一個新 DbOfTypeExpression ,產生一個由給定輸入集合中完全符合指定類型元素組成的集合。
public:
[System::Runtime::CompilerServices::Extension]
static System::Data::Common::CommandTrees::DbOfTypeExpression ^ OfTypeOnly(System::Data::Common::CommandTrees::DbExpression ^ argument, System::Data::Metadata::Edm::TypeUsage ^ type);
public static System.Data.Common.CommandTrees.DbOfTypeExpression OfTypeOnly(this System.Data.Common.CommandTrees.DbExpression argument, System.Data.Metadata.Edm.TypeUsage type);
static member OfTypeOnly : System.Data.Common.CommandTrees.DbExpression * System.Data.Metadata.Edm.TypeUsage -> System.Data.Common.CommandTrees.DbOfTypeExpression
<Extension()>
Public Function OfTypeOnly (argument As DbExpression, type As TypeUsage) As DbOfTypeExpression
參數
- argument
- DbExpression
一個 DbExpression 指定輸入集合的 。
- type
- TypeUsage
輸入集合元素必須完全匹配才能被納入結果集合的類型元資料。
傳回
一個新的 DbOfTypeExpression,包含指定的集合參數與型別,以及一個 ExpressionKind 的 OfTypeOnly。
例外狀況
argument 或 type 為空值。
argument 沒有集合結果型別,或 type 與集合結果型別 argument的元素類型不在同一型態階層中。
備註
DbOfTypeExpression 要求 擁有 argument 一個集合結果型別,且該集合結果型別具有多型元素型別 type ,且該型別與該元素型別具有相同型態階層。