Ensures that a relationship for a particular parent id and entity type exists in a relationships collection. Used with in-memory entities that are already fetched from the database.

Namespace: MonoSoftware.MonoX.Repositories
Assembly: MonoX (in MonoX.dll) Version: 5.1.40.5065 (5.1.40.5065)

Syntax

C#
public virtual SnRelationshipEntity EnsureRelationshipExists(
	Guid parentId,
	int entityType,
	EntityCollection<SnRelationshipEntity> relationships
)
Visual Basic
Public Overridable Function EnsureRelationshipExists ( 
	parentId As Guid,
	entityType As Integer,
	relationships As EntityCollection(Of SnRelationshipEntity)
) As SnRelationshipEntity
Visual C++
public:
virtual SnRelationshipEntity^ EnsureRelationshipExists(
	Guid parentId, 
	int entityType, 
	EntityCollection<SnRelationshipEntity^>^ relationships
)
F#
abstract EnsureRelationshipExists : 
        parentId : Guid * 
        entityType : int * 
        relationships : EntityCollection<SnRelationshipEntity> -> SnRelationshipEntity 
override EnsureRelationshipExists : 
        parentId : Guid * 
        entityType : int * 
        relationships : EntityCollection<SnRelationshipEntity> -> SnRelationshipEntity 

Parameters

parentId
Type: System..::..Guid
Parent id.
entityType
Type: System..::..Int32
Entity type.
relationships
Type: EntityCollection<(Of <(<'SnRelationshipEntity>)>)>
Relationships collection.

Return Value

Type: SnRelationshipEntity
An existing (or newly created) relationship.

Implements

IRelationshipRepository..::..EnsureRelationshipExists(Guid, Int32, EntityCollection<(Of <<'(SnRelationshipEntity>)>>))

See Also