---
title: "Interface ISettingsClient"
slug: "sdk--stylelabs.m.sdk.clients.isettingsclient"
abstract: ""
---
# Interface ISettingsClient

Client for fetching setting and category entities.

## Namespace: StylelabsStylelabs.MSdkClients

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public interface ISettingsClient
```

## Methods

### GetCategoryIdAsync(string)

Gets the id of a category by name.

#### Declaration

```csharp
Task<long?> GetCategoryIdAsync(string name)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | name | The category name. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>long | Id of the category entity. |

### GetSettingAsync(string, string, IEntityLoadConfiguration)

Gets the setting with the specified `name` from the specified `category`. If the category or setting could not be found, null is returned.

#### Declaration

```csharp
Task<IEntity> GetSettingAsync(string category, string name, IEntityLoadConfiguration loadConfiguration = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | category | The category to get the setting from. |
| string | name | The name of the setting to get. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | Load configuration. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) | The setting with the specified name from the specified category or null if that setting doesn't exist. |

### GetSettingsForCategoryAsync(string, IEntityLoadConfiguration)

Gets the settings for the specified `category`.

#### Declaration

```csharp
Task<IList<IEntity>> GetSettingsForCategoryAsync(string category, IEntityLoadConfiguration loadConfiguration = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | category | The category to get the setting for. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | Load configuration. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>IList<>[IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) | A list of all setting entities for the specified category. |

#### Exceptions

| Type | Condition |
| --- | --- |
| [NotFoundException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.notfoundexception.html) | Unable to find the category with the specified name. |
