DbExpressionBuilder.IsOfOnly Method (DbExpression, TypeUsage)
Creates a new DbIsOfExpression expression that determines whether the given argument is of the specified type, and only that type (not 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 IsOfOnly.
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.