DbExpressionBuilder.Property 方法

定義

建立新的 DbPropertyExpression,表示要擷取指定的屬性。

多載

Property(DbExpression, EdmProperty)

建立新的 DbPropertyExpression,表示要擷取指定的屬性。

Property(DbExpression, NavigationProperty)

建立新的 DbPropertyExpression,表示要擷取指定的巡覽屬性。

Property(DbExpression, RelationshipEndMember)

建立新的 DbPropertyExpression,表示要擷取指定的關聯終端成員。

Property(DbExpression, String)

建立新的 DbPropertyExpression,表示要從給定的執行個體中,擷取具有指定名稱的執行個體屬性。

Property(DbExpression, EdmProperty)

建立新的 DbPropertyExpression,表示要擷取指定的屬性。

C#
public static System.Data.Common.CommandTrees.DbPropertyExpression Property (this System.Data.Common.CommandTrees.DbExpression instance, System.Data.Metadata.Edm.EdmProperty propertyMetadata);

參數

instance
DbExpression

要從其中擷取屬性的執行個體。 如果屬性為靜態,可能是 null。

propertyMetadata
EdmProperty

要擷取的屬性中繼資料。

傳回

表示屬性擷取的新 DbPropertyExpression。

例外狀況

propertyMetadata 是 null 或 instance 是 null,且屬性不是靜態的。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Property(DbExpression, NavigationProperty)

建立新的 DbPropertyExpression,表示要擷取指定的巡覽屬性。

C#
public static System.Data.Common.CommandTrees.DbPropertyExpression Property (this System.Data.Common.CommandTrees.DbExpression instance, System.Data.Metadata.Edm.NavigationProperty navigationProperty);

參數

instance
DbExpression

要從其中擷取巡覽屬性的執行個體。

navigationProperty
NavigationProperty

要擷取的巡覽屬性中繼資料。

傳回

表示巡覽屬性擷取的新 DbPropertyExpression。

例外狀況

navigationPropertyinstance 為 null。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Property(DbExpression, RelationshipEndMember)

建立新的 DbPropertyExpression,表示要擷取指定的關聯終端成員。

C#
public static System.Data.Common.CommandTrees.DbPropertyExpression Property (this System.Data.Common.CommandTrees.DbExpression instance, System.Data.Metadata.Edm.RelationshipEndMember relationshipEnd);

參數

instance
DbExpression

要從其中擷取關聯性端成員的執行個體。

relationshipEnd
RelationshipEndMember

要擷取的關聯性端成員中繼資料。

傳回

表示關聯終端成員擷取的新 DbPropertyExpression。

例外狀況

relationshipEnd 是 null 或 instance 是 null,且屬性不是靜態的。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Property(DbExpression, String)

建立新的 DbPropertyExpression,表示要從給定的執行個體中,擷取具有指定名稱的執行個體屬性。

C#
public static System.Data.Common.CommandTrees.DbPropertyExpression Property (this System.Data.Common.CommandTrees.DbExpression instance, string propertyName);

參數

instance
DbExpression

要從其中擷取屬性的執行個體。

propertyName
String

要擷取的屬性名稱。

傳回

表示屬性擷取的新 DbPropertyExpression。

例外狀況

propertyName 是 null 或 instance 是 null,且屬性不是靜態的。

instance 型別未宣告任何含有指定名稱的屬性。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1