Table of Contents

Class OpenBiApiClientBaseEntityExtensions

Namespace
BiExcellence.OpenBi.Api.BaseEntities
Assembly
BiExcellence.OpenBi.Api.Client.dll

Extension methods for the /baseentities REST API.

public static class OpenBiApiClientBaseEntityExtensions
Inheritance
object
OpenBiApiClientBaseEntityExtensions

Methods

AssignTableAttributeToBaseEntityAsync(IOpenBiApiClient, string, string, CancellationToken)

Assigns a table attribute (schema column) to this base entity's dynamically-named child table, migrating that table's schema. The attribute has to exist already - see CreateTableAttributeAsync(IOpenBiApiClient, CreateTableAttributeRequest, CancellationToken); once attached, every entity of this base entity can carry a value for it in its customAttributes. Idempotent: attaching one that is already attached changes nothing. A 404 means there is no base entity or no table attribute with that id; a 409 that the base entity already has a column of that name from a different attribute. RemoveTableAttributeFromBaseEntityAsync(IOpenBiApiClient, string, string, CancellationToken) detaches it again.

public static Task AssignTableAttributeToBaseEntityAsync(this IOpenBiApiClient client, string baseEntityId, string tableAttributeId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
baseEntityId string
tableAttributeId string
cancellationToken CancellationToken

Returns

Task

CreateBaseEntityAsync(IOpenBiApiClient, CreateBaseEntityRequest, CancellationToken)

Creates a base entity, and with it the table for its entities; the server names that table and returns the name as EntityTableName. A new base entity has no columns: create the table attributes with CreateTableAttributeAsync(IOpenBiApiClient, CreateTableAttributeRequest, CancellationToken) and attach them with AssignTableAttributeToBaseEntityAsync(IOpenBiApiClient, string, string, CancellationToken). UpdateBaseEntityAsync(IOpenBiApiClient, string, CreateBaseEntityRequest, CancellationToken) creates as well, under an id of the caller's choosing.

public static Task<BaseEntity?> CreateBaseEntityAsync(this IOpenBiApiClient client, CreateBaseEntityRequest baseEntity, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
baseEntity CreateBaseEntityRequest
cancellationToken CancellationToken

Returns

Task<BaseEntity>

DeleteBaseEntityAsync(IOpenBiApiClient, string, CancellationToken)

Deletes a base entity. Its entities go with it: the table holding them is dropped, and its table attribute assignments are removed. An unknown id is not an error.

public static Task DeleteBaseEntityAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

GetBaseEntitiesAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken)

Lists base entities (GET baseentities), with the shared list options of OpenBiListRequest. A base entity is a user-defined table: the definition, whose columns are table attributes; its rows are the entities of GetEntitiesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken).

public static Task<OpenBiListResult<BaseEntity>> GetBaseEntitiesAsync(this IOpenBiApiClient client, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<BaseEntity>>

GetBaseEntityAsync(IOpenBiApiClient, string, CancellationToken)

Reads one base entity by id, in the same shape GetBaseEntitiesAsync(IOpenBiApiClient, OpenBiListRequest?, CancellationToken) returns. Throws an OpenBiApiException with status 404 when there is no base entity with this id.

public static Task<BaseEntity> GetBaseEntityAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<BaseEntity>

RemoveTableAttributeFromBaseEntityAsync(IOpenBiApiClient, string, string, CancellationToken)

Removes a table attribute (schema column) from this base entity's dynamically-named child table, migrating that table's schema: the column is dropped together with the values stored in it. The attribute itself survives and stays attached to any other base entity. tableAttributeId is the id that was passed to AssignTableAttributeToBaseEntityAsync(IOpenBiApiClient, string, string, CancellationToken). A 404 means there is no such base entity or table attribute, or the attribute is not attached to this base entity.

public static Task RemoveTableAttributeFromBaseEntityAsync(this IOpenBiApiClient client, string baseEntityId, string tableAttributeId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
baseEntityId string
tableAttributeId string
cancellationToken CancellationToken

Returns

Task

UpdateBaseEntityAsync(IOpenBiApiClient, string, CreateBaseEntityRequest, CancellationToken)

Creates or updates the base entity with the given id: an id that is not there yet is inserted rather than answered with a 404.

public static Task<BaseEntity?> UpdateBaseEntityAsync(this IOpenBiApiClient client, string id, CreateBaseEntityRequest baseEntity, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
baseEntity CreateBaseEntityRequest
cancellationToken CancellationToken

Returns

Task<BaseEntity>