---
title: "Class DataSourceBase"
slug: "sdk--stylelabs.m.sdk.models.base.datasources.datasourcebase"
abstract: ""
---
# Class DataSourceBase

Base class for data source.

## Inheritance

object

DataSourceBase

[DataSourceBase<T>](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.base.datasources.generic.datasourcebase-1.html)

## Implements

[IDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.idatasource.html)

[IResource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iresource.html)

## Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsBaseDataSources

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public abstract class DataSourceBase : IDataSource, IResource
```

## Properties

### CreatedBy

Gets the id of the user who created this resource. null if it has not been created.

#### Declaration

```csharp
public long? CreatedBy { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| long |  |

### CreatedOn

Gets the date on which this resource was created. null if it has not been created.

#### Declaration

```csharp
public DateTime? CreatedOn { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| DateTime |  |

### IsSystemOwned

Gets or sets a value indicating whether the datasource is editable. false (default) allows the datasource to be editable, false locks the datasource preventing any further modifications.

#### Declaration

```csharp
public bool IsSystemOwned { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| bool |  |

### Labels

Gets optional translation(s) of the canonical name.

#### Declaration

```csharp
public IDictionary<CultureInfo, string> Labels { get; protected set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| IDictionary<, >CultureInfostring |  |

### ModifiedBy

Gets the id of the user who modified this resource. null if it has not been created.

#### Declaration

```csharp
public long? ModifiedBy { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| long |  |

### ModifiedOn

Gets the date on which this resource was modified. null if it has not been created.

#### Declaration

```csharp
public DateTime? ModifiedOn { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| DateTime |  |

### Name

Gets the name of the datasource. Can only contain letters, numbers, dots or underscores. Because it is used as an identifier, this also needs to be unique.

#### Declaration

```csharp
public string Name { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| string |  |

### Type

Gets the type of the datasource.

#### Declaration

```csharp
public abstract DataSourceType Type { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [DataSourceType](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.datasourcetype.html) |  |

## Methods

### GetDataSourceValues()

Gets a list of the data source values. Use the properties on [IFlatDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iflatdatasource.html) or [IHierarchicalDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ihierarchicaldatasource.html). to make changes.

#### Declaration

```csharp
public abstract IList<IDataSourceValue> GetDataSourceValues()
```

#### Returns

| Type | Description |
| --- | --- |
| IList<>[IDataSourceValue](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.idatasourcevalue.html) | The list of [IDataSourceValue](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.idatasourcevalue.html). |

### Implements

[IDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.idatasource.html)

[IResource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iresource.html)
