DbExpressionBuilder.Property 方法 (DbExpression, NavigationProperty)
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
建立新的 DbPropertyExpression,表示要擷取指定的導覽屬性。
命名空間: System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification := "required for this feature")> _
<ExtensionAttribute> _
Public Shared Function Property ( _
instance As DbExpression, _
navigationProperty As NavigationProperty _
) As DbPropertyExpression
'用途
Dim instance As DbExpression
Dim navigationProperty As NavigationProperty
Dim returnValue As DbPropertyExpression
returnValue = instance.Property(navigationProperty)
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "required for this feature")]
public static DbPropertyExpression Property(
this DbExpression instance,
NavigationProperty navigationProperty
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1011:ConsiderPassingBaseTypesAsParameters", Justification = L"required for this feature")]
[ExtensionAttribute]
public:
static DbPropertyExpression^ Property(
DbExpression^ instance,
NavigationProperty^ navigationProperty
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "required for this feature")>]
static member Property :
instance:DbExpression *
navigationProperty:NavigationProperty -> DbPropertyExpression
public static function Property(
instance : DbExpression,
navigationProperty : NavigationProperty
) : DbPropertyExpression
參數
- instance
類型:System.Data.Entity.Core.Common.CommandTrees.DbExpression
要從其中擷取導覽屬性的執行個體。
- navigationProperty
類型:System.Data.Entity.Core.Metadata.Edm.NavigationProperty
要擷取之導覽屬性的中繼資料。
傳回值
類型:System.Data.Entity.Core.Common.CommandTrees.DbPropertyExpression
表示導覽屬性擷取的新 DbPropertyExpression。
使用注意事項
在 Visual Basic 和 C# 中,您可以在任何 DbExpression 類型物件中呼叫這個方法以做為執行個體。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱 https://msdn.microsoft.com/zh-tw/library/bb384936(v=vs.113)或 https://msdn.microsoft.com/zh-tw/library/bb383977(v=vs.113)。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentNullException | navigationProperty 為 null 或 instance 為 null。 |
請參閱
參考
System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder 命名空間