RelationshipManager.GetRelatedReference<TTargetEntity> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
通过使用关系名称和目标角色名称的指定组合,获取相关对象的 EntityReference<TEntity>。
public System.Data.Entity.Core.Objects.DataClasses.EntityReference<TTargetEntity> GetRelatedReference<TTargetEntity> (string relationshipName, string targetRoleName) where TTargetEntity : class;
member this.GetRelatedReference : string * string -> System.Data.Entity.Core.Objects.DataClasses.EntityReference<'argetEntity (requires 'argetEntity : null)> (requires 'argetEntity : null)
Public Function GetRelatedReference(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String) As EntityReference(Of TTargetEntity)
类型参数
- TTargetEntity
返回的 EntityReference<TEntity> 的类型。
参数
- relationshipName
- String
要浏览的关系的名称。 关系名称不由命名空间限定。
- targetRoleName
- String
要浏览的目标角色的名称。 指示在关系中浏览的方向。
返回
EntityReference<TTargetEntity>
相关对象的 EntityReference<TEntity>。
例外
指定的角色返回了 , EntityCollection<TEntity> 而不是 EntityReference<TEntity> 。