Partager via


DbEntityEntry<TEntity>.Reference<TProperty>, méthode (Expression<Func<TEntity, TProperty>>)

[Cette page concerne Entity Framework version 6. La dernière version est disponible sous le nom de package 'Entity Framework' NuGet. Pour plus d'informations sur Entity Framework, consultez msdn.com/data/ef.]

Obtient un objet qui représente la propriété de navigation de référence (à savoir qui n'est pas une collection) de cette entité vers une autre entité.

Espace de noms :  System.Data.Entity.Infrastructure
Assembly :  EntityFramework (dans EntityFramework.dll)

Syntaxe

'Déclaration
<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)
'Utilisation
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.

Paramètres de type

  • TProperty
    Type de la propriété.

Paramètres

Valeur de retour

Type : System.Data.Entity.Infrastructure.DbReferenceEntry<TEntity, TProperty>
Objet qui représente la propriété de navigation.

Voir aussi

Référence

DbEntityEntry<TEntity> Classe

Surcharge Reference

Espace de noms System.Data.Entity.Infrastructure