Zum Hauptinhalt springen

IRuntimeRepository

Namespace: Meshmakers.Octo.Runtime.Contracts.Repositories

Interface of runtime repository, a repository that is used to access runtime entities.

public interface IRuntimeRepository

Properties​

TenantId​

Returns the tenant id

public abstract string TenantId { get; }

Property Value​

String

Methods​

LoadCacheForTenantAsync(ICkCacheService)​

Loads the construction kit cache for the tenant based on the data in the repository.

Task LoadCacheForTenantAsync(ICkCacheService cacheService)

Parameters​

cacheService ICkCacheService
Cache service to load the cache into

Returns​

Task

GetSessionAsync()​

Gets a new session

Task<IOctoSession> GetSessionAsync()

Returns​

Task<IOctoSession>
The session object to handle a transaction

GetRtEntityByRtIdAsync(IOctoSession, RtEntityId)​

Gets an entity by its runtime id.

Task<RtEntity> GetRtEntityByRtIdAsync(IOctoSession session, RtEntityId rtEntityId)

Parameters​

session IOctoSession
The session object

rtEntityId RtEntityId
The runtime id

Returns​

Task<RtEntity>

GetRtEntityByRtIdAsync<TEntity>(IOctoSession, OctoObjectId)​

Gets an entity by its runtime id.

Task<TEntity> GetRtEntityByRtIdAsync<TEntity>(IOctoSession session, OctoObjectId rtId)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
The session object

rtId OctoObjectId
The object id

Returns​

Task<TEntity>

GetRtEntitiesByIdAsync(IOctoSession, RtCkId<CkTypeId>, IReadOnlyList<OctoObjectId>, RtEntityQueryOptions, Nullable<Int32>, Nullable<Int32>)​

Gets entities based on the query options.

Task<IResultSet<RtEntity>> GetRtEntitiesByIdAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, IReadOnlyList<OctoObjectId> rtIds, RtEntityQueryOptions rtEntityQueryOptions, Nullable<int> skip, Nullable<int> take)

Parameters​

session IOctoSession
The session object

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtIds IReadOnlyList<OctoObjectId>
Object ids of the runtime entities

rtEntityQueryOptions RtEntityQueryOptions
Query options for data query

skip Nullable<Int32>
Number of items to skip

take Nullable<Int32>
Number of items to take

Returns​

Task<IResultSet<RtEntity>>
Returns a result set of the given type

GetRtEntitiesByIdAsync<TEntity>(IOctoSession, IReadOnlyList<OctoObjectId>, RtEntityQueryOptions, Nullable<Int32>, Nullable<Int32>)​

Gets entities based on the query options.

Task<IResultSet<TEntity>> GetRtEntitiesByIdAsync<TEntity>(IOctoSession session, IReadOnlyList<OctoObjectId> rtIds, RtEntityQueryOptions rtEntityQueryOptions, Nullable<int> skip, Nullable<int> take)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
The session object

rtIds IReadOnlyList<OctoObjectId>
Object ids of the runtime entities

rtEntityQueryOptions RtEntityQueryOptions
Query options for data query

skip Nullable<Int32>
Number of items to skip

take Nullable<Int32>
Number of items to take

Returns​

Task<IResultSet<TEntity>>
Returns a result set of the given type

GetRtEntitiesByTypeAsync(IOctoSession, RtCkId<CkTypeId>, RtEntityQueryOptions, Nullable<Int32>, Nullable<Int32>)​

Gets entities based on the query options.

Task<IResultSet<RtEntity>> GetRtEntitiesByTypeAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, RtEntityQueryOptions rtEntityQueryOptions, Nullable<int> skip, Nullable<int> take)

Parameters​

session IOctoSession
The session object

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtEntityQueryOptions RtEntityQueryOptions
Query options for data query

skip Nullable<Int32>
Number of items to skip

take Nullable<Int32>
Number of items to take

Returns​

Task<IResultSet<RtEntity>>

GetRtEntitiesByTypeAsync<TEntity>(IOctoSession, RtEntityQueryOptions, Nullable<Int32>, Nullable<Int32>)​

Task<IResultSet<TEntity>> GetRtEntitiesByTypeAsync<TEntity>(IOctoSession session, RtEntityQueryOptions rtEntityQueryOptions, Nullable<int> skip, Nullable<int> take)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
The session object

rtEntityQueryOptions RtEntityQueryOptions
Query options for data query

skip Nullable<Int32>
Number of items to skip

take Nullable<Int32>
Number of items to take

Returns​

Task<IResultSet<TEntity>>

GetRtAssociationsAsync(IOctoSession, RtEntityId, RtAssociationExtendedQueryOptions)​

Gets associations for a runtime entity

Task<IResultSet<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, RtEntityId rtEntityId, RtAssociationExtendedQueryOptions associationExtendedQueryOptions)

Parameters​

session IOctoSession
The session object

rtEntityId RtEntityId
Runtime entity identifier to get associations for

associationExtendedQueryOptions RtAssociationExtendedQueryOptions
Options of the association query

Returns​

Task<IResultSet<RtAssociation>>
Result set with available associations

GetRtAssociationsAsync(IOctoSession, IEnumerable<RtEntityId>, RtAssociationExtendedQueryOptions)​

Gets associations for a runtime entity.

Task<IMultipleOriginResultSet<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<RtEntityId> rtEntityIds, RtAssociationExtendedQueryOptions associationExtendedQueryOptions)

Parameters​

session IOctoSession
The session object

rtEntityIds IEnumerable<RtEntityId>
Runtime entity identifiers to get associations for

associationExtendedQueryOptions RtAssociationExtendedQueryOptions
Options of the association query

Returns​

Task<IMultipleOriginResultSet<RtAssociation>>
Result set with available associations

GetRtAssociationOrDefaultAsync(IOctoSession, RtEntityId, RtEntityId, RtCkId<CkAssociationRoleId>)​

Gets an association by its origin, target and role id.

Task<RtAssociation> GetRtAssociationOrDefaultAsync(IOctoSession session, RtEntityId originRtEntityId, RtEntityId targetRtEntityId, RtCkId<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 RtCkId<CkAssociationRoleId>
Construction kit role id of the association

Returns​

Task<RtAssociation>

AsQueryableAsync<TEntity>(IOctoSession)​

Returns the data source access object for the given entity type

Task<IQueryable<TEntity>> AsQueryableAsync<TEntity>(IOctoSession session)

Type Parameters​

TEntity

Parameters​

session IOctoSession

Returns​

Task<IQueryable<TEntity>>

AsQueryable<TEntity>(IOctoSession)​

Returns the data source access object for the given entity type

IQueryable<TEntity> AsQueryable<TEntity>(IOctoSession session)

Type Parameters​

TEntity

Parameters​

session IOctoSession

Returns​

IQueryable<TEntity>

GetRtEntitiesGraphByTypeAsync(IOctoSession, RtCkId<CkTypeId>, RtEntityQueryOptions, ICollection<NavigationPair>, Nullable<Int32>, Nullable<Int32>)​

Retrieves a graph of runtime entities based on the given type and role id direction pairs.

Task<IResultSet<RtEntityGraphItem>> GetRtEntitiesGraphByTypeAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, RtEntityQueryOptions rtEntityQueryOptions, ICollection<NavigationPair> roleIdDirectionPairs, Nullable<int> skip, Nullable<int> take)

Parameters​

session IOctoSession

ckTypeId RtCkId<CkTypeId>

rtEntityQueryOptions RtEntityQueryOptions

roleIdDirectionPairs ICollection<NavigationPair>

skip Nullable<Int32>

take Nullable<Int32>

Returns​

Task<IResultSet<RtEntityGraphItem>>

GetRtEntitiesGraphByIdAsync(IOctoSession, RtCkId<CkTypeId>, IReadOnlyList<OctoObjectId>, RtEntityQueryOptions, IEnumerable<NavigationPair>, Nullable<Int32>, Nullable<Int32>)​

Retrieves a graph of runtime entities based on the given runtime identifier and role id direction pairs.

Task<IResultSet<RtEntityGraphItem>> GetRtEntitiesGraphByIdAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, IReadOnlyList<OctoObjectId> rtIds, RtEntityQueryOptions rtEntityQueryOptions, IEnumerable<NavigationPair> roleIdDirectionPairs, Nullable<int> skip, Nullable<int> take)

Parameters​

session IOctoSession
The session object

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtIds IReadOnlyList<OctoObjectId>
Object ids of the runtime entities

rtEntityQueryOptions RtEntityQueryOptions
Query options for data query

roleIdDirectionPairs IEnumerable<NavigationPair>
>Role id direction pairs that are loaded with this request

skip Nullable<Int32>
Number of items to skip

take Nullable<Int32>
Number of items to take

Returns​

Task<IResultSet<RtEntityGraphItem>>
Returns a result set of the given type

CreateTransientRtAssociation(RtEntityId, RtCkId<CkAssociationRoleId>, RtEntityId)​

Creates an instance of a runtime association

RtAssociation CreateTransientRtAssociation(RtEntityId originRtEntityId, RtCkId<CkAssociationRoleId> ckRoleId, RtEntityId targetRtEntityId)

Parameters​

originRtEntityId RtEntityId
Runtime id of the origin entity

ckRoleId RtCkId<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.

CreateTransientRtEntityByRtCkIdAsync(RtCkId<CkTypeId>)​

Creates an instance of a runtime entity

Task<RtEntity> CreateTransientRtEntityByRtCkIdAsync(RtCkId<CkTypeId> rtCkTypeId)

Parameters​

rtCkTypeId RtCkId<CkTypeId>
The model version independent construction kit type id

Returns​

Task<RtEntity>
Instance of the given construction kit type

CreateTransientRtEntityAsync(CkId<CkTypeId>)​

Creates an instance of a runtime entity

Task<RtEntity> CreateTransientRtEntityAsync(CkId<CkTypeId> ckTypeId)

Parameters​

ckTypeId CkId<CkTypeId>
The model version specific construction kit type id

Returns​

Task<RtEntity>
Instance of the given construction kit type

CreateTransientRtEntityAsync<TEntity>()​

Creates a typed version of a runtime entity

Task<TEntity> CreateTransientRtEntityAsync<TEntity>()

Type Parameters​

TEntity
Type derived from RtEntity

Returns​

Task<TEntity>
Instance of the given construction kit type

InsertOneRtEntityAsync(IOctoSession, RtCkId<CkTypeId>, RtEntity)​

Inserts a single runtime entity

Task InsertOneRtEntityAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, RtEntity rtEntity)

Parameters​

session IOctoSession
Session object for transaction handling

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtEntity RtEntity
Object to insert

Returns​

Task

InsertOneRtEntityAsync<TEntity>(IOctoSession, TEntity)​

Inserts a single runtime entity

Task InsertOneRtEntityAsync<TEntity>(IOctoSession session, TEntity rtEntity)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

rtEntity TEntity
Object to insert

Returns​

Task

InsertManyRtEntityAsync(IOctoSession, RtCkId<CkTypeId>, ICollection<RtEntity>)​

Inserts multiple runtime entities

Task InsertManyRtEntityAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, ICollection<RtEntity> rtEntities)

Parameters​

session IOctoSession
Session object for transaction handling

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtEntities ICollection<RtEntity>
Objects to insert

Returns​

Task

InsertManyRtEntityAsync<TEntity>(IOctoSession, ICollection<TEntity>)​

Inserts multiple runtime entities

Task InsertManyRtEntityAsync<TEntity>(IOctoSession session, ICollection<TEntity> rtEntities)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

rtEntities ICollection<TEntity>
Objects to insert

Returns​

Task

ReplaceOneRtEntityByIdAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId, RtEntity)​

Replace a single runtime entity

Task ReplaceOneRtEntityByIdAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, OctoObjectId rtId, RtEntity rtEntity)

Parameters​

session IOctoSession
Session object for transaction handling

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtId OctoObjectId
Runtime object id

rtEntity RtEntity
Runtime object that is used as replacement

Returns​

Task

ReplaceOneRtEntityByIdAsync<TEntity>(IOctoSession, OctoObjectId, TEntity)​

Replace a single runtime entity

Task ReplaceOneRtEntityByIdAsync<TEntity>(IOctoSession session, OctoObjectId rtId, TEntity rtEntity)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

rtId OctoObjectId
Runtime object id

rtEntity TEntity
Runtime object that is used as replacement

Returns​

Task

ReplaceOneRtEntityAsync(IOctoSession, FieldFilterCriteria, RtEntity)​

Replace a single runtime entity

Task ReplaceOneRtEntityAsync(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, RtEntity entity)

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

entity RtEntity
Runtime object that is used as replacement

Returns​

Task

ReplaceOneRtEntityAsync<TEntity>(IOctoSession, FieldFilterCriteria, TEntity)​

Replace a single runtime entity

Task ReplaceOneRtEntityAsync<TEntity>(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, TEntity entity)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

entity TEntity
Runtime object that is used as replacement

Returns​

Task

UpdateOneRtEntityByIdAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId, RtEntity)​

Updates a single runtime entity. Only attributes of the entity that are set in the update object are updated.

Task UpdateOneRtEntityByIdAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, OctoObjectId rtId, RtEntity rtEntity)

Parameters​

session IOctoSession
Session object for transaction handling

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtId OctoObjectId
Runtime object id

rtEntity RtEntity
Runtime object that is used as replacement

Returns​

Task

UpdateOneRtEntityByIdAsync<TEntity>(IOctoSession, OctoObjectId, TEntity)​

Updates a single runtime entity. Only attributes of the entity that are set in the update object are updated.

Task UpdateOneRtEntityByIdAsync<TEntity>(IOctoSession session, OctoObjectId rtId, TEntity rtEntity)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

rtId OctoObjectId
Runtime object id

rtEntity TEntity
Runtime object that is used as replacement

Returns​

Task

UpdateOneRtEntityAsync(IOctoSession, FieldFilterCriteria, RtEntity)​

Updates a single runtime entity. Only attributes of the entity that are set in the update object are updated.

Task UpdateOneRtEntityAsync(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, RtEntity rtEntity)

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

rtEntity RtEntity
Runtime object that is used as replacement

Returns​

Task

UpdateOneRtEntityAsync<TEntity>(IOctoSession, FieldFilterCriteria, TEntity)​

Updates a single runtime entity. Only attributes of the entity that are set in the update object are updated.

Task UpdateOneRtEntityAsync<TEntity>(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, TEntity rtEntity)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

rtEntity TEntity
Runtime object that is used as replacement

Returns​

Task

UpdateManyRtEntityAsync(IOctoSession, FieldFilterCriteria, RtEntity)​

Updates a multiple runtime entities. Only attributes of the entity that are set in the update object are updated.

Task UpdateManyRtEntityAsync(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, RtEntity rtEntity)

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

rtEntity RtEntity
Runtime object that is used as replacement

Returns​

Task

UpdateManyRtEntityAsync<TEntity>(IOctoSession, FieldFilterCriteria, TEntity)​

Updates multiple runtime entities. Only attributes of the entity that are set in the update object are updated.

Task UpdateManyRtEntityAsync<TEntity>(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, TEntity rtEntity)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

rtEntity TEntity
Runtime object that is used as replacement

Returns​

Task

DeleteOneRtEntityByRtIdAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId, DeleteOptions)​

Deletes a single runtime entity by its runtime id

Task DeleteOneRtEntityByRtIdAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, OctoObjectId rtId, DeleteOptions deleteOptions)

Parameters​

session IOctoSession
Session object for transaction handling

ckTypeId RtCkId<CkTypeId>
Construction kit type id

rtId OctoObjectId
Runtime identifier of the entity

deleteOptions DeleteOptions
Option to control the delete operation

Returns​

Task

DeleteOneRtEntityByRtIdAsync<TEntity>(IOctoSession, OctoObjectId, DeleteOptions)​

Deletes a single runtime entity by its runtime id

Task DeleteOneRtEntityByRtIdAsync<TEntity>(IOctoSession session, OctoObjectId rtId, DeleteOptions deleteOptions)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

rtId OctoObjectId
Runtime object id

deleteOptions DeleteOptions
Option to control the delete operation

Returns​

Task

DeleteOneRtEntityAsync(IOctoSession, RtCkId<CkTypeId>, FieldFilterCriteria, DeleteOptions)​

Deletes a single runtime entity by the given filter options

Task DeleteOneRtEntityAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, FieldFilterCriteria fieldFilterCriteria, DeleteOptions deleteOptions)

Parameters​

session IOctoSession
Session object for transaction handling

ckTypeId RtCkId<CkTypeId>
Construction kit type id

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

deleteOptions DeleteOptions
Option to control the delete operation

Returns​

Task

DeleteOneRtEntityAsync<TEntity>(IOctoSession, FieldFilterCriteria, DeleteOptions)​

Deletes a single runtime entity by the given filter options

Task DeleteOneRtEntityAsync<TEntity>(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, DeleteOptions deleteOptions)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

deleteOptions DeleteOptions
Option to control the delete operation

Returns​

Task

DeleteManyRtEntitiesAsync(IOctoSession, RtCkId<CkTypeId>, FieldFilterCriteria, DeleteOptions)​

Deletes all entities with the given filter options

Task DeleteManyRtEntitiesAsync(IOctoSession session, RtCkId<CkTypeId> ckTypeId, FieldFilterCriteria fieldFilterCriteria, DeleteOptions deleteOptions)

Parameters​

session IOctoSession
Session object for transaction handling

ckTypeId RtCkId<CkTypeId>
Construction kit type id

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

deleteOptions DeleteOptions
Option to control the delete operation

Returns​

Task

DeleteManyRtEntitiesAsync<TEntity>(IOctoSession, FieldFilterCriteria, DeleteOptions)​

Deletes all entities with the given filter options

Task DeleteManyRtEntitiesAsync<TEntity>(IOctoSession session, FieldFilterCriteria fieldFilterCriteria, DeleteOptions deleteOptions)

Type Parameters​

TEntity
The type of entity derived from RtEntity

Parameters​

session IOctoSession
Session object for transaction handling

fieldFilterCriteria FieldFilterCriteria
Object that contains the filter criteria

deleteOptions DeleteOptions
Option to control the delete operation

Returns​

Task

ApplyChangesAsync(IOctoSession, IReadOnlyList<IEntityUpdateInfo<RtEntity>>, IReadOnlyList<AssociationUpdateInfo>, OperationResult)​

Applies changes to the runtime repository

Task ApplyChangesAsync(IOctoSession session, IReadOnlyList<IEntityUpdateInfo<RtEntity>> entityUpdateInfoList, IReadOnlyList<AssociationUpdateInfo> associationUpdateInfoList, OperationResult operationResult)

Parameters​

session IOctoSession
Session object for transaction handling

entityUpdateInfoList IReadOnlyList<IEntityUpdateInfo<RtEntity>>
List of runtime entity updates

associationUpdateInfoList IReadOnlyList<AssociationUpdateInfo>
List of runtime association updates

operationResult OperationResult
Result of the operation

Returns​

Task

ApplyChangesAsync(IOctoSession, IReadOnlyList<IEntityUpdateInfo<RtEntity>>, IReadOnlyList<AssociationUpdateInfo>, DeleteOptions, OperationResult)​

Applies changes to the runtime repository

Task ApplyChangesAsync(IOctoSession session, IReadOnlyList<IEntityUpdateInfo<RtEntity>> entityUpdateInfoList, IReadOnlyList<AssociationUpdateInfo> associationUpdateInfoList, DeleteOptions deleteOptions, OperationResult operationResult)

Parameters​

session IOctoSession
Session object for transaction handling

entityUpdateInfoList IReadOnlyList<IEntityUpdateInfo<RtEntity>>
List of runtime entity updates

associationUpdateInfoList IReadOnlyList<AssociationUpdateInfo>
List of runtime association updates

deleteOptions DeleteOptions
The default delete operation when there are entities to delete

operationResult OperationResult
Result of the operation

Returns​

Task

ApplyChangesAsync(IOctoSession, IReadOnlyList<AssociationUpdateInfo>, OperationResult)​

Applies changes to the runtime repository

Task ApplyChangesAsync(IOctoSession session, IReadOnlyList<AssociationUpdateInfo> associationUpdateInfoList, OperationResult operationResult)

Parameters​

session IOctoSession
Session object for transaction handling

associationUpdateInfoList IReadOnlyList<AssociationUpdateInfo>
List of runtime association updates

operationResult OperationResult
Result of the operation

Returns​

Task

ApplyChangesAsync(IOctoSession, IReadOnlyList<IEntityUpdateInfo<RtEntity>>, OperationResult)​

Applies changes to the runtime repository

Task ApplyChangesAsync(IOctoSession session, IReadOnlyList<IEntityUpdateInfo<RtEntity>> entityUpdateInfoList, OperationResult operationResult)

Parameters​

session IOctoSession
Session object for transaction handling

entityUpdateInfoList IReadOnlyList<IEntityUpdateInfo<RtEntity>>
List of runtime entity updates

operationResult OperationResult
Result of the operation

Returns​

Task

ApplyChangesAsync(IOctoSession, IReadOnlyList<IEntityUpdateInfo<RtEntity>>, DeleteOptions, OperationResult)​

Applies changes to the runtime repository

Task ApplyChangesAsync(IOctoSession session, IReadOnlyList<IEntityUpdateInfo<RtEntity>> entityUpdateInfoList, DeleteOptions deleteOptions, OperationResult operationResult)

Parameters​

session IOctoSession
Session object for transaction handling

entityUpdateInfoList IReadOnlyList<IEntityUpdateInfo<RtEntity>>
List of runtime entity updates

deleteOptions DeleteOptions
The default delete operation when there are entities to delete

operationResult OperationResult
Result of the operation

Returns​

Task

UploadTemporaryLargeBinaryAsync(IOctoSession, String, String, DateTime, Stream, CancellationToken)​

Uploads a file to be cached in the repository

Task<OctoObjectId> UploadTemporaryLargeBinaryAsync(IOctoSession session, string filename, string contentType, DateTime expiryDateTime, Stream stream, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

filename String
Filename of the file

contentType String
Content type of the file

expiryDateTime DateTime
Expiry date time of the file

stream Stream
Binary stream of the file

cancellationToken CancellationToken
An optional cancellation token

Returns​

Task<OctoObjectId>

ReplaceTemporaryLargeBinaryAsync(IOctoSession, String, String, Stream, CancellationToken)​

Replaces a cached large binary file in the repository based on the file name

Task<OctoObjectId> ReplaceTemporaryLargeBinaryAsync(IOctoSession session, string filename, string contentType, Stream stream, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

filename String
Filename of the file

contentType String
Content type of the file

stream Stream
Stream of the file

cancellationToken CancellationToken
An optional cancellation token

Returns​

Task<OctoObjectId>
Object id of the large binary

DeleteTemporaryLargeBinaryAsync(IOctoSession, OctoObjectId, CancellationToken)​

Deletes a large binary file from the repository

Task DeleteTemporaryLargeBinaryAsync(IOctoSession session, OctoObjectId largeBinaryId, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

largeBinaryId OctoObjectId
Object id of the large binary

cancellationToken CancellationToken
An optional cancellation token

Returns​

Task

DeleteExpiredTemporaryLargeBinariesAsync(IOctoSession, DateTime, CancellationToken)​

Deletes all expired temporary large binaries from the repository

Task DeleteExpiredTemporaryLargeBinariesAsync(IOctoSession session, DateTime expiryDateTime, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

expiryDateTime DateTime
Expiry date time to filter expired binaries

cancellationToken CancellationToken
An optional cancellation token

Returns​

Task

DeleteAllTemporaryLargeBinariesAsync(IOctoSession, CancellationToken)​

Deletes all temporary large binaries from the repository

Task DeleteAllTemporaryLargeBinariesAsync(IOctoSession session, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

cancellationToken CancellationToken
An optional cancellation token

Returns​

Task

DownloadLargeBinaryAsync(IOctoSession, OctoObjectId, CancellationToken)​

Downloads a large binary file from the repository based on the large binary id

Task<IDownloadStreamHandler> DownloadLargeBinaryAsync(IOctoSession session, OctoObjectId largeBinaryId, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

largeBinaryId OctoObjectId
Object id of the large binary

cancellationToken CancellationToken
An optional cancellation token

Returns​

Task<IDownloadStreamHandler>
Handler for the download stream

GetLargeBinaryInfoAsync(IOctoSession, OctoObjectId, CancellationToken)​

Gets the metadata of a large binary regardless of its binary type (AB#4985), including the owning entity id stamped at upload time.

Task<IBinaryInfo> GetLargeBinaryInfoAsync(IOctoSession session, OctoObjectId largeBinaryId, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

largeBinaryId OctoObjectId
Object id of the large binary

cancellationToken CancellationToken
An optional cancellation token

Returns​

Task<IBinaryInfo>
Binary info including the owning entity id, or null when the binary does not exist

GetTemporaryLargeBinaryAsync(IOctoSession, OctoObjectId, CancellationToken)​

Gets a large binary file from the repository based on the large binary id

Task<IBinaryInfo> GetTemporaryLargeBinaryAsync(IOctoSession session, OctoObjectId binaryId, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

binaryId OctoObjectId
Object id of the large binary

cancellationToken CancellationToken
Optional cancellation token

Returns​

Task<IBinaryInfo>
Binary info of the file including size, content type, etc.

GetTemporaryLargeBinaryAsync(IOctoSession, String, CancellationToken)​

Gets a large binary file from the repository based on the filename and binary type

Task<IBinaryInfo> GetTemporaryLargeBinaryAsync(IOctoSession session, string fileName, CancellationToken cancellationToken)

Parameters​

session IOctoSession
Session object for transaction handling

fileName String
Filename of the file

cancellationToken CancellationToken
Optional cancellation token

Returns​

Task<IBinaryInfo>
Binary info of the file including size, content type, etc.

BulkInsertRtEntitiesAsync(IOctoSession, IEnumerable<RtEntity>, BulkOperationOptions)​

Imports a list of runtime entities in bulk.

Task<AggregatedBulkImportResult> BulkInsertRtEntitiesAsync(IOctoSession session, IEnumerable<RtEntity> rtEntityList, BulkOperationOptions options)

Parameters​

session IOctoSession
Session object for transaction handling

rtEntityList IEnumerable<RtEntity>
List of runtime entities to import

options BulkOperationOptions
Bulk operation options for the import

Returns​

Task<AggregatedBulkImportResult>
Aggregated result of the bulk import operation

BulkRtAssociationsAsync(IOctoSession, IEnumerable<RtAssociation>, BulkOperationOptions)​

Imports a list of runtime entities in bulk.

Task<IBulkImportResult> BulkRtAssociationsAsync(IOctoSession session, IEnumerable<RtAssociation> rtAssociations, BulkOperationOptions options)

Parameters​

session IOctoSession
Session object for transaction handling

rtAssociations IEnumerable<RtAssociation>
List of runtime associations to import

options BulkOperationOptions
Bulk operation options for the import

Returns​

Task<IBulkImportResult>
Aggregated result of the bulk import operation

DeleteRtAssociationsByIdAsync(IOctoSession, IEnumerable<OctoObjectId>)​

Deletes association edges by their association ids, bypassing the graph rule engine. Intended for the bulk import path only, which owns the consistency of what it writes (e.g. replacing the stale edge of a to-one role before upserting the imported one).

Task DeleteRtAssociationsByIdAsync(IOctoSession session, IEnumerable<OctoObjectId> associationIds)

Parameters​

session IOctoSession
Session object for transaction handling

associationIds IEnumerable<OctoObjectId>
Ids (RtAssociation.AssociationId) of the edges to delete

Returns​

Task

GetCkTypeGraphAsync(RtCkId<CkTypeId>)​

Gets the construction kit type graph from the cache service

Task<CkTypeGraph> GetCkTypeGraphAsync(RtCkId<CkTypeId> ckTypeId)

Parameters​

ckTypeId RtCkId<CkTypeId>
The ck type id

Returns​

Task<CkTypeGraph>

Exceptions​

RuntimeRepositoryException
CkTypeId does not exist in cache

GetRtEntitiesByTypeForMigrationAsync(IOctoSession, RtCkId<CkTypeId>)​

Gets all entities of the specified type without requiring the type to exist in the CK cache. This is used during CK model migrations when the source type may have been removed from the current schema (e.g., a type was renamed but the data migration was not yet executed). First checks the type's own collection, then searches all RtEntity collections for derived types that share a parent collection.

Task<ValueTuple<IReadOnlyList<RtEntity>, bool>> GetRtEntitiesByTypeForMigrationAsync(IOctoSession session, RtCkId<CkTypeId> rtCkTypeId)

Parameters​

session IOctoSession
The session object

rtCkTypeId RtCkId<CkTypeId>
The CK type id to query (may not exist in current CK cache)

Returns​

Task<ValueTuple<IReadOnlyList<RtEntity>, Boolean>>
A tuple of (Entities, IsSharedCollection):

  • Entities: List of entities found
  • IsSharedCollection: True if entities were found in a shared parent collection (derived type), false if found in the type's own collection (root type). When true, use in-place ckTypeId update instead of Delete+Insert.

DeleteOneRtEntityForMigrationAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId)​

Deletes an entity from a type-specific collection without requiring the type to exist in the CK cache. This is used during CK model migrations when the source type may have been removed from the current schema.

Task DeleteOneRtEntityForMigrationAsync(IOctoSession session, RtCkId<CkTypeId> rtCkTypeId, OctoObjectId rtId)

Parameters​

session IOctoSession
The session object

rtCkTypeId RtCkId<CkTypeId>
The CK type id of the entity's collection (may not exist in current CK cache)

rtId OctoObjectId
The runtime object id of the entity to delete

Returns​

Task

InsertOneRtEntityForMigrationAsync(IOctoSession, RtCkId<CkTypeId>, RtEntity)​

Inserts an entity into a type-specific collection without requiring the type to exist in the CK cache. This is used during CK model migrations when the target type may not yet be loaded in the CK cache.

Task InsertOneRtEntityForMigrationAsync(IOctoSession session, RtCkId<CkTypeId> rtCkTypeId, RtEntity rtEntity)

Parameters​

session IOctoSession
The session object

rtCkTypeId RtCkId<CkTypeId>
The CK type id of the target collection (may not exist in current CK cache)

rtEntity RtEntity
The entity to insert

Returns​

Task

Remarks:

AB#5532: this path bypasses the Secret write step of the regular mutation path. Callers run the entity through ISecretWriteNormalizer (Runtime.Engine) first - the CK migration service does - so Secret slots hold only null or an RtSecretValue (Protected, or LegacyPlaintext on hosts without keys). Implementations persist those through the Secret serializer (AB#5533) and must refuse RtSecretValueState.Pending.

UpdateCkTypeIdForMigrationAsync(IOctoSession, OctoObjectId, RtCkId<CkTypeId>)​

Updates the ckTypeId field of an entity in-place without moving it between collections. This is used during CK model migrations for derived types that share a parent collection. When the source and target types share the same root collection, no Delete+Insert is needed.

Task UpdateCkTypeIdForMigrationAsync(IOctoSession session, OctoObjectId rtId, RtCkId<CkTypeId> newCkTypeId)

Parameters​

session IOctoSession
The session object

rtId OctoObjectId
The runtime object id of the entity to update

newCkTypeId RtCkId<CkTypeId>
The new CK type id to set

Returns​

Task

UpdateAssociationCkTypeIdsForMigrationAsync(IOctoSession, RtCkId<CkTypeId>, RtCkId<CkTypeId>)​

Updates all associations that reference the old CK type id (in originCkTypeId or targetCkTypeId) to use the new CK type id. This must be called after a ChangeCkType migration to keep associations consistent with the renamed entities.

Task<int> UpdateAssociationCkTypeIdsForMigrationAsync(IOctoSession session, RtCkId<CkTypeId> oldCkTypeId, RtCkId<CkTypeId> newCkTypeId)

Parameters​

session IOctoSession
The session object

oldCkTypeId RtCkId<CkTypeId>
The old CK type id to find in associations

newCkTypeId RtCkId<CkTypeId>
The new CK type id to replace with

Returns​

Task<Int32>
The number of associations updated

UpdateAssociationRoleIdsForMigrationAsync(IOctoSession, RtCkId<CkAssociationRoleId>, RtCkId<CkAssociationRoleId>)​

Rewrites the persisted associationRoleId of every stored edge that still carries oldRoleId so that it carries newRoleId instead. Renaming an association role in a CK model is a Major change and the role id is stored on every edge, so without this rewrite every existing edge of the old role is orphaned: the model no longer defines the role the data refers to, and the navigation silently returns nothing. No other migration transform touches the role id.

Task<int> UpdateAssociationRoleIdsForMigrationAsync(IOctoSession session, RtCkId<CkAssociationRoleId> oldRoleId, RtCkId<CkAssociationRoleId> newRoleId)

Parameters​

session IOctoSession
The session object

oldRoleId RtCkId<CkAssociationRoleId>
The association role id to find

newRoleId RtCkId<CkAssociationRoleId>
The association role id to replace it with

Returns​

Task<Int32>
The number of associations updated

DropCollectionIfEmptyForMigrationAsync(RtCkId<CkTypeId>)​

Drops the collection for the specified type if it is empty. This is used during CK model migrations after a ChangeCkType transform to clean up the now-empty source collection.

Task<bool> DropCollectionIfEmptyForMigrationAsync(RtCkId<CkTypeId> rtCkTypeId)

Parameters​

rtCkTypeId RtCkId<CkTypeId>
The CK type id whose collection should be dropped

Returns​

Task<Boolean>
True if the collection was dropped, false if it was not empty or does not exist

RewriteAttributeValueForMigrationAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId, String, Object)​

Rewrites a single attribute value on an existing entity without going through the CK cache. Used by CK model migrations whose transform changes the shape of an attribute (e.g. WrapScalarInRecord) — the cache-bound IRuntimeRepository.UpdateOneRtEntityByIdAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId, RtEntity) path would validate the value against the new CK schema, which the migration is the very thing that brings the runtime data into. Implementations must touch only the specified attribute and leave the rest of the document — including associations, timestamps, version counters and other attribute slots — untouched. The rtChangedDateTime field is updated as part of the rewrite so downstream change-detection still sees the entity as modified.

Task RewriteAttributeValueForMigrationAsync(IOctoSession session, RtCkId<CkTypeId> rtCkTypeId, OctoObjectId rtId, string attributeId, object newValue)

Parameters​

session IOctoSession
The session object

rtCkTypeId RtCkId<CkTypeId>
The CK type id of the entity's collection (may not exist in current CK cache)

rtId OctoObjectId
The runtime object id of the entity to rewrite

attributeId String
The CK attribute id of the slot to overwrite

newValue Object
The new value to assign to the slot

Returns​

Task

Remarks:

AB#5532: callers normalise Secret values first (ISecretWriteNormalizer.NormalizeAttributeValue); the secret sweep (ISecretMaintenanceService) writes through this method too. The value of a Secret slot is null, an RtSecretValue (Protected → BSON sub-document { _t: "OctoSecret", e: ... }, LegacyPlaintext → the string unchanged), a plain String (only the emergency Decrypt sweep), or a record (array) whose Secret sub-values follow the same rules. Implementations (AB#5533) must refuse RtSecretValueState.Pending.

RewriteAttributeValueIfUnchangedForMigrationAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId, String, Object, Object)​

Conditional variant of IRuntimeRepository.RewriteAttributeValueForMigrationAsync(IOctoSession, RtCkId<CkTypeId>, OctoObjectId, String, Object) (compare-and-swap, AB#5532): the slot is rewritten only when the value stored right now still equals expectedValue, the value the caller read before it computed newValue. A caller that reads an entity, transforms an attribute and writes it back (the secret sweep) would otherwise overwrite a value changed in between with a transformation of the old one.

Task<bool> RewriteAttributeValueIfUnchangedForMigrationAsync(IOctoSession session, RtCkId<CkTypeId> rtCkTypeId, OctoObjectId rtId, string attributeId, object expectedValue, object newValue)

Parameters​

session IOctoSession
The session object

rtCkTypeId RtCkId<CkTypeId>
The CK type id of the entity's collection (may not exist in current CK cache)

rtId OctoObjectId
The runtime object id of the entity to rewrite

attributeId String
The CK attribute id of the slot to overwrite

expectedValue Object
The value the caller read; null matches a null or missing slot. Compared with StoredAttributeValueComparer: a protected secret by its envelope, a legacy secret by its text, a record (array) as a whole.

newValue Object
The new value to assign to the slot (same rules as the unconditional rewrite)

Returns​

Task<Boolean>
true when the slot was rewritten; false when the stored value no longer equals expectedValue or the entity no longer exists - nothing was written.

Remarks:

The default implementation throws NotSupportedException, like the unconditional rewrite on repositories without CK-cache-free write support. rtCkTypeId is the entity's own (concrete) type: implementations must find the entity where it is actually stored - an entity of a derived type lives in the storage of its collection root (e.g. every System.Communication/*Configuration in the one of System/Configuration) - and must not answer false merely because they looked in the wrong place (AB#5533: the sweep reported every such value as "modified concurrently").