DbEntityEntry<TEntity>.Reference<TProperty> 方法 (Expression<Func<TEntity, TProperty>>)
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
取得物件,表示 從此實體到另一個實體的參考 (非集合) 導覽屬性。
命名空間: System.Data.Entity.Infrastructure
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
Public Function Reference(Of TProperty As Class) ( _
navigationProperty As Expression(Of Func(Of TEntity, TProperty)) _
) As DbReferenceEntry(Of TEntity, TProperty)
'用途
Dim instance As DbEntityEntry
Dim navigationProperty As Expression(Of Func(Of TEntity, TProperty))
Dim returnValue As DbReferenceEntry(Of TEntity, TProperty)
returnValue = instance.Reference(navigationProperty)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public DbReferenceEntry<TEntity, TProperty> Reference<TProperty>(
Expression<Func<TEntity, TProperty>> navigationProperty
)
where TProperty : class
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
public:
generic<typename TProperty>
where TProperty : ref class
DbReferenceEntry<TEntity, TProperty>^ Reference(
Expression<Func<TEntity, TProperty>^>^ navigationProperty
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
member Reference :
navigationProperty:Expression<Func<'TEntity, 'TProperty>> -> DbReferenceEntry<'TEntity, 'TProperty> when 'TProperty : not struct
JScript does not support generic types and methods.
類型參數
- TProperty
此屬性的類型。
參數
- navigationProperty
類型:System.Linq.Expressions.Expression<Func<TEntity, TProperty>>
表示導覽屬性的運算式。
傳回值
類型:System.Data.Entity.Infrastructure.DbReferenceEntry<TEntity, TProperty>
表示導覽屬性的物件。