1. EntitiesClientBase

Class EntitiesClientBase

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Contains functionality to get and manipulate entities.

Inheritance
System.Object
EntitiesClientBase
Implements
Namespace: Stylelabs.M.Sdk.Models.Clients
Assembly: Stylelabs.M.Sdk.dll
Syntax
public abstract class EntitiesClientBase : object, IEntitiesClient
Remarks

When possible, always include the specific properties and relations that are required when fetching entities. IEntityLoadConfiguration

Constructors

EntitiesClientBase(IMClient)

Declaration
protected EntitiesClientBase(IMClient client)
Parameters
TypeNameDescription
IMClientclient

Methods

DeleteAsync(Int64)

Deletes the IEntity with the specified id in M. If the entity doesn't exist, nothing will happen.

Declaration
public abstract Task DeleteAsync(long entityId)
Parameters
TypeNameDescription
System.Int64entityId

The id of the entity to delete.

Returns
TypeDescription
Task

A representing the asynchronous operation.

Exceptions
TypeCondition
ForbiddenException

Thrown when the entity exists but could not be deleted.

GetAsync(Int64, IEntityLoadConfiguration)

Gets the IEntity instance with the specified id.

Declaration
public abstract Task<IEntity> GetAsync(long id, IEntityLoadConfiguration loadConfiguration = null)
Parameters
TypeNameDescription
System.Int64id

The id of the entity to get.

IEntityLoadConfigurationloadConfiguration

The loading configuration for the entity.

Returns
TypeDescription
Task<IEntity>

The entity or null when it was not found.

GetAsync(String, IEntityLoadConfiguration)

Gets the IEntity instance with the specified identifier.

Declaration
public abstract Task<IEntity> GetAsync(string identifier, IEntityLoadConfiguration loadConfiguration = null)
Parameters
TypeNameDescription
System.Stringidentifier

The identifier of the entity to get.

IEntityLoadConfigurationloadConfiguration

The loading configuration for the entity.

Returns
TypeDescription
Task<IEntity>

The entity or null when it was not found.

GetByDefinitionAsync(String, IEntityLoadConfiguration, Int32, Int32)

Queries for entities of the specified definition.

Declaration
public Task<IEntityQueryResult> GetByDefinitionAsync(string definition, IEntityLoadConfiguration loadConfiguration = null, int skip = null, int take = null)
Parameters
TypeNameDescription
System.Stringdefinition

The name of the definition to get the entities for (case insensitive).

IEntityLoadConfigurationloadConfiguration

The loading configuration for entity.

System.Int32skip

Skip specified number of entities. If no value is specified, no items will be skipped.

System.Int32take

Take only specified number of entities. If no value is specified, the default Take will be used.

Returns
TypeDescription
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
public IIdIterator GetEntityIdIterator(string definition)
Parameters
TypeNameDescription
System.Stringdefinition

The name of the definition to get the entities for (case insensitive).

Returns
TypeDescription
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
public IEntityIterator GetEntityIterator(string definition, IEntityLoadConfiguration loadConfiguration = null)
Parameters
TypeNameDescription
System.Stringdefinition

The name of the definition to get the entities for (case insensitive).

IEntityLoadConfigurationloadConfiguration

The loading configuration for entity.

Returns
TypeDescription
IEntityIterator

The iterator.

GetIdsByDefinitionAsync(String, Int32, Int32)

Queries for entity ids of the specified definition.

Declaration
public Task<IIdQueryResult> GetIdsByDefinitionAsync(string definition, int skip = null, int take = null)
Parameters
TypeNameDescription
System.Stringdefinition

The name of the definition to get the entities for (case insensitive).

System.Int32skip

Skip specified number of entities. If no value is specified, no items will be skipped.

System.Int32take

Take only specified number of entities. If no value is specified, the default Take will be used.

Returns
TypeDescription
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
public abstract Task<IList<IEntity>> GetManyAsync(IEnumerable<long> ids, IEntityLoadConfiguration loadConfiguration = null)
Parameters
TypeNameDescription
IEnumerable<System.Int64>ids

The ids of the entities to get.

IEntityLoadConfigurationloadConfiguration

The loading configuration for the entity.

Returns
TypeDescription
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
public Task<IList<IEntity>> GetManyAsync(IEnumerable<string> identifiers, IEntityLoadConfiguration loadConfiguration = null)
Parameters
TypeNameDescription
IEnumerable<System.String>identifiers

The identifiers of the entities to get.

IEntityLoadConfigurationloadConfiguration

The loading configuration for the entity.

Returns
TypeDescription
Task<IList<IEntity>>

A (non-null) list of entities.

SaveAsync(IEntity)

Saves the entity in M.

Declaration
public abstract Task<long> SaveAsync(IEntity entity)
Parameters
TypeNameDescription
IEntityentity

The entity to save.

Returns
TypeDescription
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
TypeCondition
ValidationException

Thrown when the entity could not be saved because a validation error occurred.

Implements

この記事を改善するための提案がある場合は、 お知らせください!