DbExpressionBuilder.IsOfOnly Method (DbExpression, TypeUsage)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a new DbIsOfExpression expression that determines whether the given argument is of the specified type, and only that type (not a subtype).

Namespace:   System.Data.Common.CommandTrees.ExpressionBuilder
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public static DbIsOfExpression IsOfOnly(
	this DbExpression argument,
	TypeUsage type


Type: System.Data.Common.CommandTrees.DbExpression

An expression that specifies the instance.

Type: System.Data.Metadata.Edm.TypeUsage

Type metadata that specifies the type that the instance's result type should be compared to.

Return Value

Type: System.Data.Common.CommandTrees.DbIsOfExpression

A new DbIsOfExpression with the specified instance and type and DbExpressionKind IsOfOnly.

Exception Condition

argument or type is null.


type is not in the same type hierarchy as the result type of argument.

DbIsOfExpression requires that argument has a polymorphic result type, and that type is a type from the same type hierarchy as that result type.

.NET Framework
Available since 4.5
Return to top