1. Stylelabs.M.Sdk.Fluent.Wrappers

Class FluentEntities

Provides access to entities in a fluent way.

Inheritance

object

FluentEntities

Namespace: StylelabsStylelabs.MSdkFluentWrappers

Assembly: Stylelabs.M.Sdk.Fluent.dll

Syntax

public class FluentEntities

Constructors

FluentEntities(IEntitiesClient, ITypedEntityFactory, IEntityLoadConfiguration)

Initializes a new instance of the FluentEntities class.

Declaration

public FluentEntities(IEntitiesClient entitiesClient, ITypedEntityFactory typedEntityFactory, IEntityLoadConfiguration entityLoadConfiguration)

Parameters

TypeNameDescription
IEntitiesCliententitiesClientThe IEntitiesClient instance.
ITypedEntityFactorytypedEntityFactoryThe ITypedEntityFactory instance.
IEntityLoadConfigurationentityLoadConfigurationThe IEntityLoadConfiguration.

Methods

Get(long)

Gets the FluentEntity instance with the specified id.

Declaration

public FluentEntity Get(long id)

Parameters

TypeNameDescription
longidThe id of the entity to get.

Returns

TypeDescription
FluentEntityThe entity or null when it was not found.

Get(string)

Gets the FluentEntity instance with the specified identifier.

Declaration

public FluentEntity Get(string identifier)

Parameters

TypeNameDescription
stringidentifierThe identifier of the entity to get.

Returns

TypeDescription
FluentEntityThe entity or null when it was not found.

Get(long)

Gets the typed entity instance with the specified id.

Declaration

public TTypedEntity Get<TTypedEntity>(long id) where TTypedEntity : ITypedEntity

Parameters

TypeNameDescription
longidThe id of the entity to get.

Returns

TypeDescription
TTypedEntityThe entity or null when it was not found.

Type Parameters

NameDescription
TTypedEntityThe type of the typed entity.

Get(string)

Gets the typed entity instance with the specified identifier.

Declaration

public TTypedEntity Get<TTypedEntity>(string identifier) where TTypedEntity : ITypedEntity

Parameters

TypeNameDescription
stringidentifierThe identifier of the entity to get.

Returns

TypeDescription
TTypedEntityThe entity or null when it was not found.

Type Parameters

NameDescription
TTypedEntityThe type of the typed entity.

GetByDefinition(string, int, int)

Queries for entities of the specified definition.

Declaration

public IEnumerable<FluentEntity> GetByDefinition(string definitionName, int skip = null, int take = null)

Parameters

TypeNameDescription
stringdefinitionNameThe name of the definition to get the entities for (case insensitive).
intskipSkip specified number of entities. If no value is specified, no items will be skipped.
inttakeTake only specified number of entities. If no value is specified, the default Take will be used.

Returns

TypeDescription
IEnumerable<>FluentEntityA (non-null) list of FluentEntity.

GetMany(long[])

Gets multiple FluentEntity instances with the specified ids. The result can have a different ordering and size (when entities don't exist) than the input.

Declaration

public IEnumerable<FluentEntity> GetMany(long[] ids)

Parameters

TypeNameDescription
longidsThe ids of the entities to get.

Returns

TypeDescription
IEnumerable<>FluentEntityA (non-null) list of FluentEntity.

GetMany(string[])

Gets multiple FluentEntity instances with the specified identifiers. The result can have a different ordering and size (when entities don't exist) than the input.

Declaration

public IEnumerable<FluentEntity> GetMany(string[] identifiers)

Parameters

TypeNameDescription
stringidentifiersThe identifiers of the entities to get.

Returns

TypeDescription
IEnumerable<>FluentEntityA (non-null) list of FluentEntity.
If you have suggestions for improving this article, let us know!