Class OpenBiApiClientEntityExtensions
Extension methods for the /baseentities/{baseEntityId}/entities REST API.
public static class OpenBiApiClientEntityExtensions
- Inheritance
-
objectOpenBiApiClientEntityExtensions
Methods
CreateEntityAsync(IOpenBiApiClient, string, CreateEntityRequest, CancellationToken)
Creates an entity in a base entity. Only values for table attributes attached to that base entity are kept; the rest is ignored rather than rejected. A 404 means there is no base entity with this id. UpdateEntityAsync(IOpenBiApiClient, string, string, CreateEntityRequest, CancellationToken) creates as well, under an id of the caller's choosing.
public static Task<Entity?> CreateEntityAsync(this IOpenBiApiClient client, string baseEntityId, CreateEntityRequest entity, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientbaseEntityIdstringentityCreateEntityRequestcancellationTokenCancellationToken
Returns
- Task<Entity>
DeleteEntityAsync(IOpenBiApiClient, string, string, CancellationToken)
Deletes one entity of a base entity. An unknown entity id is not an error; a 404 means there is no base entity with this id.
public static Task DeleteEntityAsync(this IOpenBiApiClient client, string baseEntityId, string id, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientbaseEntityIdstringidstringcancellationTokenCancellationToken
Returns
- Task
GetEntitiesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken)
Lists the entities of a base entity (GET baseentities/{baseEntityId}/entities), with the shared list
options of OpenBiListRequest. Their columns are the table attributes attached to that base
entity, and the values are in CustomAttributes. A 404 means there is no base entity
with this id.
public static Task<OpenBiListResult<Entity>> GetEntitiesAsync(this IOpenBiApiClient client, string baseEntityId, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientbaseEntityIdstringrequestOpenBiListRequestcancellationTokenCancellationToken
Returns
- Task<OpenBiListResult<Entity>>
GetEntityAsync(IOpenBiApiClient, string, string, CancellationToken)
Reads one entity of a base entity, in the same shape GetEntitiesAsync(IOpenBiApiClient, string, OpenBiListRequest?, CancellationToken) returns. Throws an OpenBiApiException with status 404 when there is no such base entity or no entity with this id in it.
public static Task<Entity> GetEntityAsync(this IOpenBiApiClient client, string baseEntityId, string id, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientbaseEntityIdstringidstringcancellationTokenCancellationToken
Returns
- Task<Entity>
UpdateEntityAsync(IOpenBiApiClient, string, string, CreateEntityRequest, CancellationToken)
Creates or updates the entity with the given id: an id that is not there yet is inserted rather than answered with a 404. A 404 means there is no base entity with this id.
public static Task<Entity?> UpdateEntityAsync(this IOpenBiApiClient client, string baseEntityId, string id, CreateEntityRequest entity, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClientbaseEntityIdstringidstringentityCreateEntityRequestcancellationTokenCancellationToken
Returns
- Task<Entity>