RelationshipManager.Create(IEntityWithRelationships) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new RelationshipManager object.
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
Parameters
- owner
- IEntityWithRelationships
Reference to the entity that is calling this method.
Returns
The requested RelationshipManager.
Remarks
Used by data classes that support relationships. If the change tracker requests the RelationshipManager property and the data class does not already have a reference to one of these objects, it calls this method to create one, then saves a reference to that object. On subsequent accesses to that property, the data class should return the saved reference. The reason for using a factory method instead of a public constructor is to emphasize that this is not something you would normally call outside of a data class. By requiring that these objects are created via this method, developers should give more thought to the operation, and will generally only use it when they explicitly need to get an object of this type. It helps define the intended usage.