---
title: "Interface IDataSourceFactory"
slug: "sdk--stylelabs.m.sdk.factories.idatasourcefactory"
abstract: ""
---
# Interface IDataSourceFactory

Describes a factory to create datasources.

## Namespace: StylelabsStylelabs.MSdkFactories

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public interface IDataSourceFactory
```

## Methods

### CreateFlatDataSource(string)

Creates a new flat data source instance with the specified name.

#### Declaration

```csharp
IFlatDataSource CreateFlatDataSource(string name)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | name | Name of the data source. |

#### Returns

| Type | Description |
| --- | --- |
| [IFlatDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iflatdatasource.html) | A new flat data source instance. |

### CreateHierarchicalDataSource(string)

Creates a new hierarchical data source instance with the specified name.

#### Declaration

```csharp
IHierarchicalDataSource CreateHierarchicalDataSource(string name)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | name | Name of the data source. |

#### Returns

| Type | Description |
| --- | --- |
| [IHierarchicalDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ihierarchicaldatasource.html) | A new hierarchical data source instance. |
