RelationshipManager.GetRelatedReference<TTargetEntity> Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém o EntityReference<TEntity> para um objeto relacionado usando a combinação especificada do nome da relação e do nome do papel do destino.
public:
generic <typename TTargetEntity>
where TTargetEntity : class, System::Data::Objects::DataClasses::IEntityWithRelationships System::Data::Objects::DataClasses::EntityReference<TTargetEntity> ^ GetRelatedReference(System::String ^ relationshipName, System::String ^ targetRoleName);
public:
generic <typename TTargetEntity>
where TTargetEntity : class System::Data::Objects::DataClasses::EntityReference<TTargetEntity> ^ GetRelatedReference(System::String ^ relationshipName, System::String ^ targetRoleName);
public System.Data.Objects.DataClasses.EntityReference<TTargetEntity> GetRelatedReference<TTargetEntity>(string relationshipName, string targetRoleName) where TTargetEntity : class, System.Data.Objects.DataClasses.IEntityWithRelationships;
public System.Data.Objects.DataClasses.EntityReference<TTargetEntity> GetRelatedReference<TTargetEntity>(string relationshipName, string targetRoleName) where TTargetEntity : class;
member this.GetRelatedReference : string * string -> System.Data.Objects.DataClasses.EntityReference<'argetEntity (requires 'argetEntity : null and 'argetEntity :> System.Data.Objects.DataClasses.IEntityWithRelationships)> (requires 'argetEntity : null and 'argetEntity :> System.Data.Objects.DataClasses.IEntityWithRelationships)
member this.GetRelatedReference : string * string -> System.Data.Objects.DataClasses.EntityReference<'argetEntity (requires 'argetEntity : null)> (requires 'argetEntity : null)
Public Function GetRelatedReference(Of TTargetEntity As {Class, IEntityWithRelationships}) (relationshipName As String, targetRoleName As String) As EntityReference(Of TTargetEntity)
Public Function GetRelatedReference(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String) As EntityReference(Of TTargetEntity)
Parâmetros de Tipo Genérico
- TTargetEntity
O tipo do retornado EntityReference<TEntity>.
Parâmetros
- relationshipName
- String
Nome da relação a gerir. O nome da relação não qualifica o namespace.
- targetRoleName
- String
Nome do papel alvo para a navegação. Indica a direção da navegação através da relação.
Devoluções
O EntityReference<TEntity> de um objeto relacionado.
Exceções
O papel especificado devolveu um EntityCollection<TEntity> em vez de um EntityReference<TEntity>.
Observações
O nome da relação não deve ser qualificado para o namespace. Ocorre um erro quando se coloca o namespace no nome da relação.