---
title: Database table API
related:
  - https://docs.kentico.com/documentation/developers-and-admins/api/objectquery-api.md
  - https://docs.kentico.com/documentation/developers-and-admins/customization/customize-system-providers.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Xperience stores most data in database tables. The API provides classes for managing the data of each table – an `Info` class, `IInfoProvider` interface (service), and an `InfoProvider` class.

![Info object database table structure in Xperience](https://docs.kentico.com/docsassets/documentation/database-table-api/DB_InfoProvider_API.png "Info object database table structure in Xperience")

## Info classes

Every `Info` class is related to a specific database table. Instances of Info classes represent entries (rows) in the given table – the class serves as a container for the data of the entry. The properties of an info class correspond to the columns of the related table.

### Info class validation

When saving info objects to the database, the system validates object code name format and uniqueness. You can extend this validation by implementing info-specific rules via `IInfoValidator<TInfo>`. See [Customize system providers](https://docs.kentico.com/documentation/developers-and-admins/customization/customize-system-providers.md#info-object-validation).

## Info class managers

The system offers the following options for CRUD operations over managed database objects.

### Generic provider class – IInfoProvider&#x20;

The `IInfoProvider<TInfo>` and its associated extension methods provide conventional CRUD API in the form of `Get`, `Set`, and `Delete` methods and their asynchronous counterparts. The `Get` and `GetAsync` methods expose multiple overloads for retrieval via ID, GUID, or code name depending on the configuration of the corresponding object type.

You can manage objects via `IInfoProvider<TInfo>` instances. Substitute `TInfo` for the `*Info` class you want to work with. We recommend this approach for all custom objects added to the system. For example, to obtain an instance of the content language manager, use:

```csharp title="Initialize a generic info object provider via dependency injection"
using CMS.DataEngine;

private readonly IInfoProvider<ContentLanguageInfo> contentLanguageProvider;

public MyClass(IInfoProvider<ContentLanguageInfo> contentLanguageProvider)
{
    this.contentLanguageProvider = contentLanguageProvider;
}
```

> **Note:** Note that not all system classes currently fully support this approach.

For bulk operations, use the `BulkInsert`, `BulkUpdate`, and `BulkDelete` methods.

If you cannot use dependency injection in your codebase, you can instantiate the generic provider via the static `CMS.DataEngine.Provider<TInfo>.Instance`.

### Dedicated provider classes

Each managed database object can have a dedicated provider class that ensures CRUD operations.

#### IInfoProvider interfaces

Most `Info` classes have a matching `IInfoProvider` interface (service), which allows basic management of the given objects – getting, creating, updating, and deleting – using the system's [ObjectQuery](https://docs.kentico.com/documentation/developers-and-admins/api/objectquery-api.md) query syntax.

You can resolve instances of `IInfoProvider` services using [dependency injection](https://docs.kentico.com/documentation/developers-and-admins/development/website-development-basics/dependency-injection.md) or via the `Provider` property of the corresponding `Info` class.

```csharp title="Code example"
using CMS.Membership;

// ...

// Gets a UserInfo object representing the user with the "Andy" username
UserInfo user = UserInfo.Provider.Get("Andy");

// Saves the user's email address to a local variable
string userEmail = user.Email;
```

#### InfoProvider classes

`InfoProvider` classes are the actual implementations of the `IInfoProvider` interfaces. Every provider manages the data of a specific table using the related `Info` objects.

We do not recommend using `InfoProvider` classes directly for basic operations, such as getting, creating, or deleting objects. Use the corresponding `IInfoProvider` service instead.
