Class FluentEntities
Provides access to entities in a fluent way.
Inheritance
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
Type | Name | Description |
---|---|---|
IEntitiesClient | entitiesClient |
The IEntitiesClient instance. |
ITypedEntityFactory | typedEntityFactory |
The ITypedEntityFactory instance. |
IEntityLoadConfiguration | entityLoadConfiguration |
Methods
Get(long)
Gets the FluentEntity instance with the specified id
.
Declaration
public FluentEntity Get(long id)
Parameters
Type | Name | Description |
---|---|---|
long | id |
The id of the entity to get. |
Returns
Type | Description |
---|---|
FluentEntity |
The 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
Type | Name | Description |
---|---|---|
string | identifier |
The identifier of the entity to get. |
Returns
Type | Description |
---|---|
FluentEntity |
The entity or null when it was not found. |
Get<TTypedEntity>(long)
Gets the typed entity instance with the specified id
.
Declaration
public TTypedEntity Get<TTypedEntity>(long id) where TTypedEntity : ITypedEntity
Parameters
Type | Name | Description |
---|---|---|
long | id |
The id of the entity to get. |
Returns
Type | Description |
---|---|
TTypedEntity |
The entity or null when it was not found. |
Type Parameters
Name | Description |
---|---|
TTypedEntity |
The type of the typed entity. |
Get<TTypedEntity>(string)
Gets the typed entity instance with the specified identifier
.
Declaration
public TTypedEntity Get<TTypedEntity>(string identifier) where TTypedEntity : ITypedEntity
Parameters
Type | Name | Description |
---|---|---|
string | identifier |
The identifier of the entity to get. |
Returns
Type | Description |
---|---|
TTypedEntity |
The entity or null when it was not found. |
Type Parameters
Name | Description |
---|---|
TTypedEntity |
The 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
Type | Name | Description |
---|---|---|
string | definitionName |
The name of the definition to get the entities for (case insensitive). |
int | skip |
Skip specified number of entities. If no value is specified, no items will be skipped. |
int | take |
Take only specified number of entities. If no value is specified, the default Take will be used. |
Returns
Type | Description |
---|---|
IEnumerable<>FluentEntity |
A (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
Type | Name | Description |
---|---|---|
long | ids |
The ids of the entities to get. |
Returns
Type | Description |
---|---|
IEnumerable<>FluentEntity |
A (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
Type | Name | Description |
---|---|---|
string | identifiers |
The identifiers of the entities to get. |
Returns
Type | Description |
---|---|
IEnumerable<>FluentEntity |
A (non-null) list of FluentEntity. |