Class EntityDefinitionsClientBase
このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。
Contains functionality to get entity definitions and their entities.
Inheritance
Implements
Namespace: Stylelabs.M.Sdk.Models.Clients
Assembly: Stylelabs.M.Sdk.dll
Syntax
Remarks
This client exposes a lot of methods that also have cached version. It is generally advised to use the cached variants.
Constructors
EntityDefinitionsClientBase(IMClient)
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IMClient | client |
Methods
CreateEntityDefinitionIdIterator(Int64)
Creates an iterator to iterate over all the available entity definition ids in the system. Results are ordered ascending by id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | pageSize |
Returns
| Type | Description |
|---|---|
| IIdIterator |
An entity definition id iterator |
CreateEntityDefinitionIterator(Int64)
Creates an iterator to iterate over all the available IEntityDefinition instances in the system. Results are ordered ascending by id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | pageSize |
Returns
| Type | Description |
|---|---|
| IEntityDefinitionIterator |
An entity definition iterator |
DeleteAsync(Int64)
Deletes the entity definition in M. If the entity definition doesn't exist, nothing will happen.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | id |
The id of the entity definition to delete. |
Returns
| Type | Description |
|---|---|
| Task |
A representing the asynchronous operation. |
Exceptions
| Type | Condition |
|---|---|
| ForbiddenException |
Thrown when the entity definition exists but could not be deleted. |
DeleteAsync(String)
Deletes the entity definition in M. If the entity definition doesn't exist, nothing will happen.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
The name of the entity definition to delete. |
Returns
| Type | Description |
|---|---|
| Task |
A representing the asynchronous operation. |
Exceptions
| Type | Condition |
|---|---|
| ForbiddenException |
Thrown when the entity definition exists but could not be deleted. |
GetAsync(Int64)
Gets the IEntityDefinition instance by the specified id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | id |
Entity definition id. |
Returns
| Type | Description |
|---|---|
| Task<IEntityDefinition> |
The IEntityDefinition or null if the entity definition does not exist. |
GetAsync(String)
Gets the IEntityDefinition instance by the specified name.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Entity definition name (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<IEntityDefinition> |
The IEntityDefinition or null if the entity definition does not exist. |
GetCachedAsync(Int64)
Gets the cached IEntityDefinition instance by the specified id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | id |
Entity definition id. |
Returns
| Type | Description |
|---|---|
| Task<IEntityDefinition> |
The IEntityDefinition or null if the entity definition does not exist. |
GetCachedAsync(String)
Gets the cached IEntityDefinition instance by the specified name.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Entity definition name (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<IEntityDefinition> |
The IEntityDefinition or null if the entity definition does not exist. |
GetIdAsync(String)
Gets the id of the specified entity definition.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Entity definition name (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<System.Nullable<System.Int64>> |
The entity definition id or null if the entity definition does not exist. |
GetIdCachedAsync(String)
Gets the id of the specified cached entity definition.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Entity definition name (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<System.Nullable<System.Int64>> |
The entity definition id or null if the entity definition does not exist. |
GetIdsAsync(IEnumerable<String>)
Gets the entity definition ids by the names of the definitions.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | names |
Entity definition names (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<IDictionary<System.String, System.Int64>> |
Non null, case-insensitive dictionary that maps the definition names to ids. |
GetIdsCachedAsync(IEnumerable<String>)
Gets the cached entity definition ids by the names of the definitions.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | names |
Entity definition names (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<IDictionary<System.String, System.Int64>> |
Non null, case-insensitive dictionary that maps the definition names to ids. |
GetManyAsync(IEnumerable<Int64>)
Gets the IEntityDefinition instances by the ids of the definitions. The result can have a different ordering and size (when definitions don't exist) than the input.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.Int64> | ids |
Returns
| Type | Description |
|---|---|
| Task<IList<IEntityDefinition>> |
Non null collection of IEntityDefinition instances. |
GetManyAsync(IEnumerable<String>)
Gets the IEntityDefinition instances by the names of the definitions. The result can have a different ordering and size (when definitions don't exist) than the input.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | names |
Entity definition names (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<IList<IEntityDefinition>> |
Non null collection of IEntityDefinition instances. |
GetManyCachedAsync(IEnumerable<Int64>)
Gets the cached IEntityDefinition instances by the ids of the definitions. The result can have a different ordering and size (when definitions don't exist) than the input.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.Int64> | ids |
Returns
| Type | Description |
|---|---|
| Task<IList<IEntityDefinition>> |
Non null collection of IEntityDefinition instances. |
GetManyCachedAsync(IEnumerable<String>)
Gets the cached IEntityDefinition instances by the names of the definitions. The result can have a different ordering and size (when definitions don't exist) than the input.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | names |
Entity definition names (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<IList<IEntityDefinition>> |
Non null collection of IEntityDefinition instances. |
GetManyIdsAsync(IEnumerable<String>)
Gets the entity definition ids by the names of the definitions.
The ids have the same ordering as the names, except for definitions that were not found.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | names |
Entity definition names (case insensitive). |
Returns
| Type | Description |
|---|---|
| Task<IList<System.Int64>> |
Non null collection of entity definition ids. |
Remarks
It is recommended to use GetIdsAsync(IEnumerable<String>) instead, because the mapping is much clearer.
GetNameAsync(Int64)
Gets the name of the IEntityDefinition with the specified id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | id |
The id of the definition to get the name of. |
Returns
| Type | Description |
|---|---|
| Task<System.String> |
The name of the specified definition or null if it doesn't exist. |
GetNameCachedAsync(Int64)
Gets the name of the cached IEntityDefinition with the specified id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | id |
The id of the definition to get the name of. |
Returns
| Type | Description |
|---|---|
| Task<System.String> |
The name of the specified definition or null if it doesn't exist. |
GetNamesAsync(IEnumerable<Int64>)
Gets the entity definition names by the ids of the definitions.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.Int64> | ids |
Entity definition ids. |
Returns
| Type | Description |
|---|---|
| Task<IDictionary<System.Int64, System.String>> |
Non null dictionary that maps the definition ids to names. |
GetNamesCachedAsync(IEnumerable<Int64>)
Gets the cached entity definition names by the ids of the definitions.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.Int64> | ids |
Entity definition ids. |
Returns
| Type | Description |
|---|---|
| Task<IDictionary<System.Int64, System.String>> |
Non null dictionary that maps the definition ids to names. |
GetRangeAsync(Int64, Int64)
Gets a set of IEntityDefinition instances in the system by specified range. Results are ordered ascending by id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | skip |
Skip specified number of entity definitions. If no value is specified, no items will be skipped. |
| System.Int64 | take |
Take only specified number of entity definitions. |
Returns
| Type | Description |
|---|---|
| Task<IEntityDefinitionQueryResult> |
A query result of entity definitions. |
GetRangeIdsAsync(Int64, Int64)
Gets a set of entity definition ids in the system by specified range. Results are ordered ascending by id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | skip |
Skip specified number of entity definitions. If no value is specified, no items will be skipped. |
| System.Int64 | take |
Take only specified number of entity definitions. |
Returns
| Type | Description |
|---|---|
| Task<IIdQueryResult> |
A query result of entity definition ids. |
SaveAsync(IEntityDefinition)
Saves the entity definition in M.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityDefinition | entityDefinition |
The entity definition to save. |
Returns
| Type | Description |
|---|---|
| Task<System.Int64> |
The id of the entity definition in M. |
Exceptions
| Type | Condition |
|---|---|
| ValidationException |
Thrown when the entity definition could not be saved because a validation error occurred. |