IRepositoryDataSource
Namespace: Meshmakers.Octo.Runtime.Contracts.Repositories
Interface for the data source of a runtime repository
public interface IRepositoryDataSource
Properties
TenantId
Returns the corresponding tenant id
public abstract string TenantId { get; }
Property Value
RtAssociations
Returns the associations collection
public abstract IDataSourceCollection<OctoObjectId, RtAssociation> RtAssociations { get; }
Property Value
IDataSourceCollection<OctoObjectId, RtAssociation>
Methods
GetRtCollection<TEntity>(CkTypeGraph)
Returns the data source access object for the given entity type
IDataSourceCollection<OctoObjectId, TEntity> GetRtCollection<TEntity>(CkTypeGraph ckTypeGraph)
Type Parameters
TEntity
The type of entity derived from <see cref="RtEntity"/>
Parameters
ckTypeGraph
CkTypeGraph
Construction kit type graph object
Returns
IDataSourceCollection<OctoObjectId, TEntity>
GetRtAssociationsAsync(IOctoSession, OctoObjectId, GraphDirections)
Gets associations for a runtime entity.
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, OctoObjectId rtId, GraphDirections direction)
Parameters
session
IOctoSession
The session object
rtId
OctoObjectId
Object id of the runtime entity
direction
GraphDirections
Direction of associations to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetRtAssociationsAsync(IOctoSession, IEnumerable<OctoObjectId>, GraphDirections)
Gets associations for multiple runtime entities.
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<OctoObjectId> rtIds, GraphDirections direction)
Parameters
session
IOctoSession
The session object
rtIds
IEnumerable<OctoObjectId>
Object id of runtime entities
direction
GraphDirections
Direction of associations to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetRtAssociationsAsync(IOctoSession, OctoObjectId, GraphDirections, CkId<CkAssociationRoleId>)
Gets associations for a runtime entity of a specific role
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, OctoObjectId rtId, GraphDirections direction, CkId<CkAssociationRoleId> roleId)
Parameters
session
IOctoSession
The session object
rtId
OctoObjectId
Object id of the runtime entity
direction
GraphDirections
Direction of associations to get
roleId
CkId<CkAssociationRoleId>
The construction kit role to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetRtAssociationsAsync(IOctoSession, IEnumerable<OctoObjectId>, GraphDirections, CkId<CkAssociationRoleId>)
Gets associations for a runtime entity of a specific role
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<OctoObjectId> rtIds, GraphDirections direction, CkId<CkAssociationRoleId> roleId)
Parameters
session
IOctoSession
The session object
rtIds
IEnumerable<OctoObjectId>
Object id of runtime entities
direction
GraphDirections
Direction of associations to get
roleId
CkId<CkAssociationRoleId>
The construction kit role to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetCurrentRtAssociationMultiplicityAsync(IOctoSession, RtEntityId, CkId<CkAssociationRoleId>, GraphDirections)
Returns the current multiplicity of a runtime association, that means the number of associations that exist for a give runtime entity and role
Task<CurrentMultiplicity> GetCurrentRtAssociationMultiplicityAsync(IOctoSession session, RtEntityId rtEntityId, CkId<CkAssociationRoleId> ckRoleId, GraphDirections direction)
Parameters
session
IOctoSession
The session object
rtEntityId
RtEntityId
Object id of the runtime entity
ckRoleId
CkId<CkAssociationRoleId>
Construction kit role id of the association
direction
GraphDirections
Direction of associations to get
Returns
GetRtAssociationOrDefaultAsync(IOctoSession, RtEntityId, RtEntityId, CkId<CkAssociationRoleId>)
Gets an association by its origin, target and role id.
Task<RtAssociation> GetRtAssociationOrDefaultAsync(IOctoSession session, RtEntityId originRtEntityId, RtEntityId targetRtEntityId, CkId<CkAssociationRoleId> ckRoleId)
Parameters
session
IOctoSession
The session object
originRtEntityId
RtEntityId
Runtime id of the origin entity
targetRtEntityId
RtEntityId
Runtime id of the target entity
ckRoleId
CkId<CkAssociationRoleId>
Construction kit role id of the association
Returns
CreateTransientRtAssociation(RtEntityId, CkId<CkAssociationRoleId>, RtEntityId)
Creates an instance of a runtime association
RtAssociation CreateTransientRtAssociation(RtEntityId originRtEntityId, CkId<CkAssociationRoleId> ckRoleId, RtEntityId targetRtEntityId)
Parameters
originRtEntityId
RtEntityId
Runtime id of the origin entity
ckRoleId
CkId<CkAssociationRoleId>
Construction kit role id of the association
targetRtEntityId
RtEntityId
Runtime id of the target entity
Returns
RtAssociation
A transient version of a role, need to be stored.