---
title: "Class RelationLoadOption"
slug: "sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption"
abstract: ""
---
# Class RelationLoadOption

Specifies which relations to load.

## Inheritance

object

RelationLoadOption

## Implements

[IRelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationloadoption.html)

[ILoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.iloadoption.html)

## Namespace: StylelabsStylelabs.MStylelabs.M.FrameworkStylelabs.M.Framework.EssentialsLoadOptions

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public class RelationLoadOption : IRelationLoadOption, ILoadOption
```

## Constructors

### RelationLoadOption()

Initializes a new instance of the [RelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption.html) class. Defaults to LoadOption.None .

#### Declaration

```csharp
public RelationLoadOption()
```

### RelationLoadOption(IEnumerable<RelationSpecification>)

Initializes a new instance of the [RelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption.html) class.

#### Declaration

```csharp
public RelationLoadOption(IEnumerable<RelationSpecification> specs)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| IEnumerable<>[RelationSpecification](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationspecification.html) | specs | Relation specifications. |

### RelationLoadOption(IEnumerable<string>)

Initializes a new instance of the [RelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption.html) class.

#### Declaration

```csharp
public RelationLoadOption(IEnumerable<string> relationNames)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| IEnumerable<>string | relationNames | Relation names. |

### RelationLoadOption(LoadOption)

Initializes a new instance of the [RelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption.html) class.

#### Declaration

```csharp
public RelationLoadOption(LoadOption loadOption)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [LoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.loadoption.html) | loadOption | A [LoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption.html). |

### RelationLoadOption(params RelationSpecification\[\])

Initializes a new instance of the [RelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption.html) class.

#### Declaration

```csharp
public RelationLoadOption(params RelationSpecification[] specs)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [RelationSpecification](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationspecification.html) | specs | Relation specifications. |

### RelationLoadOption(params string\[\])

Initializes a new instance of the [RelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.relationloadoption.html) class.

#### Declaration

```csharp
public RelationLoadOption(params string[] relationNames)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | relationNames | Relation names. |

## Properties

### All

Gets all relations.

#### Declaration

```csharp
public static IRelationLoadOption All { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IRelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationloadoption.html) |  |

### [LoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.loadoption.html)

Gets or sets the load option.

#### Declaration

```csharp
public LoadOption LoadOption { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [LoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.loadoption.html) |  |

### None

Gets no relations.

#### Declaration

```csharp
public static IRelationLoadOption None { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IRelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationloadoption.html) |  |

### Relations

Gets or sets a list of relations that need to be loaded. This is only useful when [LoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.loadoption.html) is [Custom](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.loadoption.html).

#### Declaration

```csharp
public IRelationSpecification[] Relations { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IRelationSpecification](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationspecification.html) |  |

## Methods

### DeepClone()

Creates a deep clone of this instance.

#### Declaration

```csharp
public IRelationLoadOption DeepClone()
```

#### Returns

| Type | Description |
| --- | --- |
| [IRelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationloadoption.html) | The relation load option. |

### DeepEquals(IRelationLoadOption)

Checks if this instance of [IRelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationloadoption.html) is equal to `other`.

#### Declaration

```csharp
public bool DeepEquals(IRelationLoadOption other)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IRelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationloadoption.html) | other | The relation load option. |

#### Returns

| Type | Description |
| --- | --- |
| bool | langword_csharp_True if the instances are equal; otherwise langword_csharp_False. |

### Implements

[IRelationLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.irelationloadoption.html)

[ILoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.iloadoption.html)
