Datasource factory

The datasource factory creates datasource instances for the two types of datasources.

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.

Create flat datasources

To create a flat datasource, pass a unique name for the datasource to the CreateFlatDataSource method:

RequestResponse
IFlatDataSource flatDataSource = MClient.DataSourceFactory.CreateFlatDataSource("NewFlatDataSource");

Create hierarchical datasources

To create a hierarchical datasource, pass a unique name for the datasource to the CreateHierarchicalDataSource method:

RequestResponse
IHierarchicalDataSource hierachicalDataSource = MClient.DataSourceFactory.CreateHierarchicalDataSource("NewHierarchicalDataSource");
Note

The datasource instance is not persisted. The factory only creates an object. If the datasource needs to be persisted, use the CreateAsync on the IDataSourcesClient.

Do you have some feedback for us?

If you have suggestions for improving this article,