---
title: Business meta-model
slug: commerce-connect-15/docs/business-meta-model
docTags: 
createdAt: 2026-07-30T20:34:41.000Z
---

Classes in this topic are available in the following namespaces:

- `Mediachase.BusinessFoundation.Data.Meta`
- `Mediachase.BusinessFoundation.Data.Meta.Management`

For information about working with data through business objects, see [Entity objects](docId\:vbaYk2Tal-ERsr39pxB2H).

## Elements

### MetaType

`MetaType` represents these field type declarations: string, HTML text, number, enums, file, image, and so on. `MetaType` includes common types. You can extend `MetaType` to include UI-friendly types. For example, instead of using one type of string, the Business `Meta-Model` has Short String, Long String, HTML, email, and phone number. You can easily create a MetaType based on a system type or a customized type.

### MetaEnum

`MetaEnum` represents single or multi-select enumerations. When a new `MetaEnum` is created, it registers a new meta-type.

### MetaClass

`MetaClass` represents a class containing a collection of meta-fields. You can use a `MetaClass` to create an entity object. You can modify meta-class fields (add, remove) at runtime.

BF supports 1-N, N-N, and aggregation references between two meta-classes.

### Modules

The following modules represent customized extensions you can install in the system and activate in the meta-class.

- **Change Tracking** – Adds a field to meta-class and registers user and modification date/time.
- **History** – Saves meta object modifications to the history meta-class.
- **Localization** – Allows localized field values.

## Initialization

The Business Meta Model uses a SQL Server database for data storage. To manually prepare the database, run the `SqlTables.sql`, `SqlSp.sql`, and `SqlInitialData.sql` scripts, which create the infrastructure for the meta-model data storage.

:::hint{type="info"}
**Note**
A database can have only one Business Meta-Model. A `DataContext` object represents a unique entry point to the Business Meta-Model. When you create an instance of `DataContext`, Business Meta-Model is loaded, and all properties are set to their initial values. Then, you should initialize the `DataContext.Current` static property to declare `DataContext` in the current thread. The `DataContext` is available in the current thread from the `DataContext.DataContext` static property.
:::

If the `DataContext` goes out of scope, it is not closed. So, you must explicitly close the context by calling `Dispose`.

The `DataContext.Current` property is a thread, and you should initialize it in all threads. By changing the `DataContext.Current` property, you can connect to different meta-models, but only one connection is active.

**Example:** Initializing `DataContext` in the current thread:

```csharp
// Step 0. Connection String
string connectionString = "Data Source=(local);Initial Catalog=TestDatabase;User ID=sa;Password=;";
// Step 1. Initiaze Sql Metamodel
DataContext.Current = new DataContext(connectionString);
```

In an ASP.NET application, initialize `DataContext` in the `Global.Application_BeginRequest` method.
