Class ToOneRelation<TRelation>

Defines a relation that is associated with only one entity.

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

The type of the relation.

Constructors

ToOneRelation(IMClient, TypedEntityWrapper, string)

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

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

Id

Gets or sets the value of the relation.

Declaration
RequestResponse
public virtual long? Id { get; set; }
Property Value
TypeDescription
long

Methods

GetEntityAsync(EntityLoadConfiguration)

Gets the related entity as an IEntity.

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

The IEntityLoadConfiguration.

Returns
TypeDescription
Task<>IEntity

A list of IEntity.

GetEntityAsync<TEntity>(EntityLoadConfiguration)

Gets the related entity as a typed ITypedEntity.

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

The IEntityLoadConfiguration.

Returns
TypeDescription
Task<>

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,