DbExpressionBuilder.IsOf Method (DbExpression, TypeUsage)

.NET Framework (current version)
 

Creates a new DbIsOfExpression that determines whether the given argument is of the specified type or a subtype.

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

public static DbIsOfExpression IsOf(
	this DbExpression argument,
	TypeUsage type
)

Parameters

argument
Type: System.Data.Common.CommandTrees.DbExpression

An expression that specifies the instance.

type
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 IsOf.

Exception Condition
ArgumentNullException

argument or type is null.

ArgumentException

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
Show: