Class OpenBiTableAttributeExtensions
Extension methods for table attributes.
Inheritance
Namespace: BiExcellence.OpenBi.Api.Commands.TableAttributes
Assembly: BiExcellence.OpenBi.Api.TableAttribute.dll
Syntax
public static class OpenBiTableAttributeExtensions
Methods
CreateTableAttributeAsync(IOpenBiSession, ITableAttribute, CancellationToken)
Creates or updates a table attribute.
Declaration
public static Task CreateTableAttributeAsync(this IOpenBiSession session, ITableAttribute tableAttribute, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
ITableAttribute | tableAttribute | The table attribute. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteTableAttributeAsync(IOpenBiSession, ITableAttribute, CancellationToken)
Deletes a table attribute.
Declaration
public static Task DeleteTableAttributeAsync(this IOpenBiSession session, ITableAttribute tableAttribute, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
ITableAttribute | tableAttribute | The table attribute. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteTableAttributeAsync(IOpenBiSession, string, CancellationToken)
Deletes a table attribute by its id.
Declaration
public static Task DeleteTableAttributeAsync(this IOpenBiSession session, string tableAttributeId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | tableAttributeId | The table attribute id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteTableAttributesAsync(IOpenBiSession, IEnumerable<ITableAttribute>, CancellationToken)
Deletes table attributes.
Declaration
public static Task DeleteTableAttributesAsync(this IOpenBiSession session, IEnumerable<ITableAttribute> tableAttributes, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IEnumerable<ITableAttribute> | tableAttributes | The table attributes. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DeleteTableAttributesAsync(IOpenBiSession, IEnumerable<string>, CancellationToken)
Deletes table attributes by ids.
Declaration
public static Task DeleteTableAttributesAsync(this IOpenBiSession session, IEnumerable<string> ids, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
IEnumerable<string> | ids | The table attribute ids. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
GetTableAttributeCache()
Returns the table attribute cache. Which is used by ParseCustomAttributes(JsonElement, ITableAttributes?) and SerializeCustomAttributesAsync(IOpenBiRequest, ICustomAttributes, CancellationToken)
Declaration
public static ITableAttributeCache GetTableAttributeCache()
Returns
Type | Description |
---|---|
ITableAttributeCache | The table attribute cache. |
GetTableAttributesAsync(IOpenBiSession, string, CancellationToken)
Returns the table attributes for the table name. This method ignores the ITableAttributeCache
Declaration
public static Task<ITableAttributes> GetTableAttributesAsync(this IOpenBiSession session, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | tableName | The table name. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<ITableAttributes> | The table attributes for the table name. |
GetTableAttributesAsync<T>(IOpenBiSession, CancellationToken)
Returns the table attributes for the type T
.
This method ignores the ITableAttributeCache.
Declaration
public static Task<ITableAttributes> GetTableAttributesAsync<T>(this IOpenBiSession session, CancellationToken cancellationToken = default) where T : ICustomAttributes
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<ITableAttributes> | The table attributes for the type. |
Type Parameters
Name | Description |
---|---|
T | The type. |
GetTableAttributesFromCacheAsync<T>(IOpenBiSession, CancellationToken)
Returns the table attributes for the type T
using the ITableAttributeCache.
Declaration
public static Task<ITableAttributes> GetTableAttributesFromCacheAsync<T>(this IOpenBiSession session, CancellationToken cancellationToken = default) where T : ICustomAttributes
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<ITableAttributes> | The table attributes for the type. |
Type Parameters
Name | Description |
---|---|
T | The type. |
SetTableAttributeCache(ITableAttributeCache)
Sets the table attribute cache. Which is used by ParseCustomAttributes(JsonElement, ITableAttributes?) and SerializeCustomAttributesAsync(IOpenBiRequest, ICustomAttributes, CancellationToken) Setting it to
null
will reset it to the default implementation
Declaration
public static void SetTableAttributeCache(ITableAttributeCache tableAttributeCache)
Parameters
Type | Name | Description |
---|---|---|
ITableAttributeCache | tableAttributeCache | The table attribute cache. |