Settings client

The SDK provides a Settings client to provide some extra utilities for retrieving settings.

Settings are entities that can be used with the querying client and the entities client. This client can be useful because it replaces some queries that would otherwise have to be manually written.

Note

The client variable in the following code examples refers to the IMClient instance. When using the Web SDK, the variable name can be chosen freely, but it is also called client at instantiation in the documentation.

Get the category ID

For example, the following snippet gets the id of the PortalConfiguration category:

RequestResponse
long? id = await MClient.Settings.GetCategoryIdAsync("PortalConfiguration");

Get a setting

For example, in the PortalConfiguration category, there is a setting named Authentication that can be retrieved using the following method:

RequestResponse
IEntity setting = await MClient.Settings.GetSettingAsync("PortalConfiguration", "Authentication");

It is possible to pass an entity load configuration to the client.

Get all the settings for a category

Getting all the settings for a category is also possible. For example, the following snippet gets all the rendition settings:

RequestResponse
IList<IEntity> renditionSettings = await MClient.Settings.GetSettingsForCategoryAsync("Renditions");

It is possible to pass an entity load configuration.

Do you have some feedback for us?

If you have suggestions for improving this article,