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

Class ToOneRelation

Defines a relation that is associated with only one entity.

Inheritance

object

ToOneRelation

ReadOnlyToOneRelation

Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsTypedFields

Assembly: Stylelabs.M.Sdk.dll

Syntax

public class ToOneRelation<TRelation> where TRelation : class, IToOneRelation

Type Parameters

NameDescription
TRelationThe type of the relation.

Constructors

ToOneRelation(IMClient, TypedEntityWrapper, string)

Initializes a new instance of the ToOneRelation class.

Declaration

public ToOneRelation(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

Id

Gets or sets the value of the relation.

Declaration

public virtual long? Id { get; set; }

Property Value

TypeDescription
long

Methods

GetEntityAsync(EntityLoadConfiguration)

Gets the related entity as an IEntity.

Declaration

public Task<IEntity> GetEntityAsync(EntityLoadConfiguration loadConfiguration = null)

Parameters

TypeNameDescription
EntityLoadConfigurationloadConfigurationThe IEntityLoadConfiguration.

Returns

TypeDescription
Task<>IEntityA list of IEntity.

GetEntityAsync(EntityLoadConfiguration)

Gets the related entity as a typed ITypedEntity.

Declaration

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

Parameters

TypeNameDescription
EntityLoadConfigurationloadConfigurationThe IEntityLoadConfiguration.

Returns

TypeDescription
Task<>A list of IEntity.

Type Parameters

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