Class ToOneRelation<TRelation>
Defines a relation that is associated with only one entity.
Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsTypedFields
Assembly: Stylelabs.M.Sdk.dll
Syntax
RequestResponse
public class ToOneRelation<TRelation> where TRelation : class, IToOneRelationType Parameters
| Name | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| IMClient | client |
The IMClient instance. |
| TypedEntityWrapper | wrapper |
The typed entity wrapper. |
| string | relationName |
The property name. |
Fields
Client
The client.
Declaration
RequestResponse
protected readonly IMClient ClientField Value
| Type | Description |
|---|---|
| IMClient |
Relation
The relation.
Declaration
RequestResponse
protected readonly TRelation RelationField Value
| Type | Description |
|---|---|
| TRelation |
Properties
Id
Gets or sets the value of the relation.
Declaration
RequestResponse
public virtual long? Id { get; set; }Property Value
| Type | Description |
|---|---|
| long |
Methods
GetEntityAsync(EntityLoadConfiguration)
Gets the related entity as an IEntity.
Declaration
RequestResponse
public Task<IEntity> GetEntityAsync(EntityLoadConfiguration loadConfiguration = null)Parameters
| Type | Name | Description |
|---|---|---|
| EntityLoadConfiguration | loadConfiguration |
Returns
GetEntityAsync<TEntity>(EntityLoadConfiguration)
Gets the related entity as a typed ITypedEntity.
Declaration
RequestResponse
public Task<TEntity> GetEntityAsync<TEntity>(EntityLoadConfiguration loadConfiguration = null) where TEntity : ITypedEntityParameters
| Type | Name | Description |
|---|---|---|
| EntityLoadConfiguration | loadConfiguration |
Returns
| Type | Description |
|---|---|
| Task<> |
A list of IEntity. |
Type Parameters
| Name | Description |
|---|---|
| TEntity |
The type of the entity. |