---
title: "Class ReadOnlyToManyRelation<TRelation>"
slug: "sdk--stylelabs.m.sdk.models.typed.fields.readonlytomanyrelation-1"
abstract: ""
---
# Class ReadOnlyToManyRelation<TRelation>

Defines a readonly-relation that is associated with many entities.

## Inheritance

object

[ToManyRelation](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.fields.tomanyrelation-1.html)

ReadOnlyToManyRelation<TRelation>

## Inherited Members

[ToManyRelation<TRelation>.Client](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.fields.tomanyrelation-1.html)

[ToManyRelation<TRelation>.Relation](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.fields.tomanyrelation-1.html)

[ToManyRelation<TRelation>.GetEntitiesAsync(EntityLoadConfiguration)](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.fields.tomanyrelation-1.html)

[ToManyRelation<TRelation>.GetEntitiesAsync<TEntity>(EntityLoadConfiguration)](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.fields.tomanyrelation-1.html)

## Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsTypedFields

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public class ReadOnlyToManyRelation<TRelation> : ToManyRelation<TRelation> where TRelation : class, IToManyRelation
```

## Type Parameters

| Name | Description |
| --- | --- |
| TRelation | The relation type. |

## Constructors

### ReadOnlyToManyRelation(IMClient, TypedEntityWrapper, string)

Initializes a new instance of the [ReadOnlyToManyRelation<TRelation>](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.fields.readonlytomanyrelation-1.html) class.

#### Declaration

```csharp
public ReadOnlyToManyRelation(IMClient client, TypedEntityWrapper wrapper, string relationName)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IMClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.imclient.html) | client | The [IMClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.imclient.html) instance. |
| [TypedEntityWrapper](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.utilities.typedentitywrapper.html) | wrapper | The typed entity wrapper. |
| string | relationName | The property name. |

## Properties

### Ids

Gets the value of the relation.

#### Declaration

```csharp
public override IList<long> Ids { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| IList<>long |  |

#### Overrides

Stylelabs.M.Sdk.Models.Typed.Fields.ToManyRelation<TRelation>.Ids
