DbExpressionBuilder.OfTypeOnly(DbExpression, TypeUsage) 方法

定义

创建一个新的 DbOfTypeExpression,它从指定的输入集生成完全为指定类型的元素集。

public static System.Data.Entity.Core.Common.CommandTrees.DbOfTypeExpression OfTypeOnly (this System.Data.Entity.Core.Common.CommandTrees.DbExpression argument, System.Data.Entity.Core.Metadata.Edm.TypeUsage type);
static member OfTypeOnly : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Metadata.Edm.TypeUsage -> System.Data.Entity.Core.Common.CommandTrees.DbOfTypeExpression
<Extension()>
Public Function OfTypeOnly (argument As DbExpression, type As TypeUsage) As DbOfTypeExpression

参数

argument
DbExpression

指定输入集的 DbExpression

type
TypeUsage

要使输入集的元素包括在结果集中,该元素必须严格匹配的类型的类型元数据。

返回

具有指定集参数和类型的新 DbOfTypeExpression,ExpressionKind 为 OfTypeOnly

例外

参数或类型为 null。

参数没有集合结果类型,或者类型不是与参数集合结果类型的元素类型位于同一类型层次结构中的类型。

适用于