1. Stylelabs.M.Sdk.Models.Typed.Fields

Class ToManyRelation

Defines a relation that is associated with many entities.

Inheritance

object

ToManyRelation

ReadOnlyToManyRelation

Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsTypedFields

Assembly: Stylelabs.M.Sdk.dll

Syntax

public class ToManyRelation<TRelation> where TRelation : class, IToManyRelation

Type Parameters

NameDescription
TRelationThe type of the relation.

Constructors

ToManyRelation(IMClient, TypedEntityWrapper, string)

Initializes a new instance of the ToManyRelation class.

Declaration

public ToManyRelation(IMClient client, TypedEntityWrapper wrapper, string relationName)

Parameters

TypeNameDescription
IMClientclientThe IMClient instance.
TypedEntityWrapperwrapperThe typed entity wrapper.
stringrelationNameThe property name.

Fields

Client

The client.

Declaration

protected readonly IMClient Client

Field Value

TypeDescription
IMClient

Relation

The relation.

Declaration

protected readonly TRelation Relation

Field Value

TypeDescription
TRelation

Properties

Ids

Gets or sets the value of the relation.

Declaration

public virtual IList<long> Ids { get; set; }

Property Value

TypeDescription
IList<>long

Methods

GetEntitiesAsync(EntityLoadConfiguration)

Gets the related entities as an IEntity.

Declaration

public Task<IList<IEntity>> GetEntitiesAsync(EntityLoadConfiguration loadConfiguration = null)

Parameters

TypeNameDescription
EntityLoadConfigurationloadConfigurationThe IEntityLoadConfiguration.

Returns

TypeDescription
Task<>IList<>IEntityA list of IEntity.

GetEntitiesAsync(EntityLoadConfiguration)

Gets the related entities as a typed ITypedEntity.

Declaration

public Task<IList<TEntity>> GetEntitiesAsync<TEntity>(EntityLoadConfiguration loadConfiguration = null) where TEntity : ITypedEntity

Parameters

TypeNameDescription
EntityLoadConfigurationloadConfigurationThe IEntityLoadConfiguration.

Returns

TypeDescription
Task<>IList<>A list of IEntity.

Type Parameters

NameDescription
TEntityThe type of the entity.
If you have suggestions for improving this article, let us know!