Class EntitiesClientBase
このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。
Contains functionality to get and manipulate entities.
Inheritance
Implements
Namespace: Stylelabs.M.Sdk.Models.Clients
Assembly: Stylelabs.M.Sdk.dll
Syntax
Remarks
When possible, always include the specific properties and relations that are required when fetching entities. IEntityLoadConfiguration
Constructors
EntitiesClientBase(IMClient)
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IMClient | client |
Methods
DeleteAsync(Int64)
Deletes the IEntity with the specified id in M. If the entity doesn't exist, nothing will happen.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | entityId |
The id of the entity to delete. |
Returns
| Type | Description |
|---|---|
| Task |
A representing the asynchronous operation. |
Exceptions
| Type | Condition |
|---|---|
| ForbiddenException |
Thrown when the entity exists but could not be deleted. |
GetAsync(Int64, IEntityLoadConfiguration)
Gets the IEntity instance with the specified id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | id |
The id of the entity to get. |
| IEntityLoadConfiguration | loadConfiguration |
The loading configuration for the entity. |
Returns
| Type | Description |
|---|---|
| Task<IEntity> |
The entity or null when it was not found. |
GetAsync(String, IEntityLoadConfiguration)
Gets the IEntity instance with the specified identifier.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | identifier |
The identifier of the entity to get. |
| IEntityLoadConfiguration | loadConfiguration |
The loading configuration for the entity. |
Returns
| Type | Description |
|---|---|
| Task<IEntity> |
The entity or null when it was not found. |
GetByDefinitionAsync(String, IEntityLoadConfiguration, Int32, Int32)
Queries for entities of the specified definition.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | definition |
The name of the definition to get the entities for (case insensitive). |
| IEntityLoadConfiguration | loadConfiguration |
The loading configuration for entity. |
| System.Int32 | skip |
Skip specified number of entities. If no value is specified, no items will be skipped. |
| System.Int32 | take |
Take only specified number of entities. If no value is specified, the default Take will be used. |
Returns
| Type | Description |
|---|---|
| Task<IEntityQueryResult> |
The iterator. |
GetEntityIdIterator(String)
Creates an IIdIterator instance for the specified definition that returns
entity ids Results are sorted ascending on creation date.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | definition |
The name of the definition to get the entities for (case insensitive). |
Returns
| Type | Description |
|---|---|
| IIdIterator |
The iterator. |
GetEntityIterator(String, IEntityLoadConfiguration)
Creates an IEntityIterator instance for the specified definition that returns
IEntity instances. Results are sorted ascending on creation date.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | definition |
The name of the definition to get the entities for (case insensitive). |
| IEntityLoadConfiguration | loadConfiguration |
The loading configuration for entity. |
Returns
| Type | Description |
|---|---|
| IEntityIterator |
The iterator. |
GetIdsByDefinitionAsync(String, Int32, Int32)
Queries for entity ids of the specified definition.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | definition |
The name of the definition to get the entities for (case insensitive). |
| System.Int32 | skip |
Skip specified number of entities. If no value is specified, no items will be skipped. |
| System.Int32 | take |
Take only specified number of entities. If no value is specified, the default Take will be used. |
Returns
| Type | Description |
|---|---|
| Task<IIdQueryResult> |
The iterator. |
GetManyAsync(IEnumerable<Int64>, IEntityLoadConfiguration)
Gets multiple IEntity instances with the specified ids.
The result can have a different ordering and size (when entities don't exist) than the input.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.Int64> | ids |
The ids of the entities to get. |
| IEntityLoadConfiguration | loadConfiguration |
The loading configuration for the entity. |
Returns
| Type | Description |
|---|---|
| Task<IList<IEntity>> |
A (non-null) list of entities. |
GetManyAsync(IEnumerable<String>, IEntityLoadConfiguration)
Gets multiple IEntity instances with the specified identifiers.
The result can have a different ordering and size (when entities don't exist) than the input.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | identifiers |
The identifiers of the entities to get. |
| IEntityLoadConfiguration | loadConfiguration |
The loading configuration for the entity. |
Returns
| Type | Description |
|---|---|
| Task<IList<IEntity>> |
A (non-null) list of entities. |
SaveAsync(IEntity)
Saves the entity in M.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEntity | entity |
The entity to save. |
Returns
| Type | Description |
|---|---|
| Task<System.Int64> |
The id of the entity in M. |
Remarks
The existing entity will not be updated in any way.
If any information is needed that was generated on the server after persisting,
they entity will need to be fetched again.
Exceptions
| Type | Condition |
|---|---|
| ValidationException |
Thrown when the entity could not be saved because a validation error occurred. |