Skip to main content

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

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

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

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

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