DbExpressionBuilder.IsOf Method (DbExpression, TypeUsage)
Creates a new DbIsOfExpression that determines whether the given argument is of the specified type or a subtype.
Assembly: EntityFramework (in EntityFramework.dll)
Parameters
- argument
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the instance.
- type
-
Type:
System.Data.Entity.Core.Metadata.Edm.TypeUsage
Type metadata that specifies the type that the instance's result type should be compared to.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbIsOfExpressionA 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.