Sdílet prostřednictvím


DbExpressionBuilder.TreatAs(DbExpression, TypeUsage) Metoda

Definice

Vytvoří nový objekt DbTreatExpression.

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

Parametry

argument
DbExpression

Výraz, který určuje instanci.

treatType
TypeUsage

Zadejte metadata pro typ treat-as.

Návraty

Nový DbTreatExpression se zadaným argumentem a typem.

Výjimky

argument nebo treatType má hodnotu null.

treatType není ve stejné hierarchii typů jako výsledek typu argumentu.

Platí pro