语言

RelationshipManager.Create(IEntityWithRelationships) 方法

定义

创建新的 RelationshipManager 对象。

public static System.Data.Entity.Core.Objects.DataClasses.RelationshipManager Create(System.Data.Entity.Core.Objects.DataClasses.IEntityWithRelationships owner);
static member Create : System.Data.Entity.Core.Objects.DataClasses.IEntityWithRelationships -> System.Data.Entity.Core.Objects.DataClasses.RelationshipManager
Public Shared Function Create (owner As IEntityWithRelationships) As RelationshipManager

参数

owner
IEntityWithRelationships

对调用此方法的实体的引用。

返回

请求的 RelationshipManager。

注解

由支持关系的数据类使用。 如果更改跟踪器请求 RelationshipManager 属性和数据类尚未引用其中一个对象,则调用此方法创建一个对象,然后保存对该对象的引用。 对该属性的后续访问时,数据类应返回保存的引用。 使用工厂方法而不是公共构造函数的原因是强调,这不是通常在数据类外部调用的内容。 通过此方法创建这些对象时,开发人员应更多地考虑该操作,并且通常仅在显式需要获取此类型的对象时才使用它。 它有助于定义预期使用情况。

适用于