---
title: "Class EntityFactoryBase<T>"
slug: "sdk--stylelabs.m.sdk.models.factories.entityfactorybase-1"
abstract: ""
---
# Class EntityFactoryBase<T>

Base class for the entity factories.

## Inheritance

object

EntityFactoryBase<T>

## Implements

[IEntityFactory](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.factories.ientityfactory.html)

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

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public abstract class EntityFactoryBase<T> : IEntityFactory where T : EntityBase
```

## Type Parameters

| Name | Description |
| --- | --- |
| T | The entity type. |

## Constructors

### EntityFactoryBase(IMClient, IRelationFactory, ICultureLoader, TypedEntityCreatorBase<T>)

#### Declaration

```csharp
protected EntityFactoryBase(IMClient client, IRelationFactory relationFactory, ICultureLoader cultureLoader, TypedEntityCreatorBase<T> entityCreator)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IMClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.imclient.html) | client |  |
| Stylelabs.M.Sdk.Factories.IRelationFactory | relationFactory |  |
| [ICultureLoader](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.utilities.icultureloader.html) | cultureLoader |  |
| [TypedEntityCreatorBase](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.factories.typedentitycreatorbase-1.html) | entityCreator |  |

### EntityFactoryBase(IMClient, IRelationFactory, ICultureLoader)

#### Declaration

```csharp
protected EntityFactoryBase(IMClient client, IRelationFactory relationFactory, ICultureLoader cultureLoader)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IMClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.imclient.html) | client |  |
| Stylelabs.M.Sdk.Factories.IRelationFactory | relationFactory |  |
| [ICultureLoader](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.utilities.icultureloader.html) | cultureLoader |  |

## Methods

### CreateAsync(IEntityDefinition, ICultureLoadOption)

Creates an [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) instance of the given [IEntityDefinition](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientitydefinition.html).

#### Declaration

```csharp
public Task<IEntity> CreateAsync(IEntityDefinition definition, ICultureLoadOption cultureLoadOption = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IEntityDefinition](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientitydefinition.html) | definition | The entity definition. |
| [ICultureLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.icultureloadoption.html) | cultureLoadOption | The culture load option. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) | A new [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) instance. |

### CreateAsync(string, ICultureLoadOption)

Creates an [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) instance of the [IEntityDefinition](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientitydefinition.html) corresponding to the `definitionName`.

#### Declaration

```csharp
public Task<IEntity> CreateAsync(string definitionName, ICultureLoadOption cultureLoadOption = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | definitionName | The entity definition name (case insensitive). |
| [ICultureLoadOption](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadoptions.icultureloadoption.html) | cultureLoadOption | The culture load option. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) | A new [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) instance. |

### Implements

[IEntityFactory](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.factories.ientityfactory.html)
