Class ToManyRelation<TRelation>

Defines a relation that is associated with many entities.

Inheritance
object
ToManyRelation<TRelation>
Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsTypedFields
Assembly: Stylelabs.M.Sdk.dll
Syntax
RequestResponse
public class ToManyRelation<TRelation> where TRelation : class, IToManyRelation
Type Parameters
NameDescription
TRelation

The type of the relation.

Constructors

ToManyRelation(IMClient, TypedEntityWrapper, string)

Initializes a new instance of the ToManyRelation<TRelation> class.

Declaration
RequestResponse
public ToManyRelation(IMClient client, TypedEntityWrapper wrapper, string relationName)
Parameters
TypeNameDescription
IMClientclient

The IMClient instance.

TypedEntityWrapperwrapper

The typed entity wrapper.

stringrelationName

The property name.

Fields

Client

The client.

Declaration
RequestResponse
protected readonly IMClient Client
Field Value
TypeDescription
IMClient

Relation

The relation.

Declaration
RequestResponse
protected readonly TRelation Relation
Field Value
TypeDescription
TRelation

Properties

Ids

Gets or sets the value of the relation.

Declaration
RequestResponse
public virtual IList<long> Ids { get; set; }
Property Value
TypeDescription
IList<>long

Methods

GetEntitiesAsync(EntityLoadConfiguration)

Gets the related entities as an IEntity.

Declaration
RequestResponse
public Task<IList<IEntity>> GetEntitiesAsync(EntityLoadConfiguration loadConfiguration = null)
Parameters
TypeNameDescription
EntityLoadConfigurationloadConfiguration

The IEntityLoadConfiguration.

Returns
TypeDescription
Task<>IList<>IEntity

A list of IEntity.

GetEntitiesAsync<TEntity>(EntityLoadConfiguration)

Gets the related entities as a typed ITypedEntity.

Declaration
RequestResponse
public Task<IList<TEntity>> GetEntitiesAsync<TEntity>(EntityLoadConfiguration loadConfiguration = null) where TEntity : ITypedEntity
Parameters
TypeNameDescription
EntityLoadConfigurationloadConfiguration

The IEntityLoadConfiguration.

Returns
TypeDescription
Task<>IList<>

A list of IEntity.

Type Parameters
NameDescription
TEntity

The type of the entity.

Do you have some feedback for us?

If you have suggestions for improving this article,