# EF - DataContext Attributes

When creating a provider-scoped data context (one for a specific backend), you need to decorate the type with a DataContextAttribute.

This allows application code, to easily identify the provider-specific data contexts, to use for a particular backend choice.

And, it allows other code to identify the provider and associated configuration of each type, and whatever other properties we may need to include at a later time.

<p class="callout info">NOTE: There is no need to add the attribute to a base db context type, or an app domain context type (one with DbSets).  
This only applies to the provider-specific data context types.</p>

#### Attribute Strings

Here are the standard provider choice strings:

<table border="1" id="bkmrk-backend-provider-nam" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3745%;"></col><col style="width: 33.3745%;"></col><col style="width: 33.3745%;"></col></colgroup><tbody><tr><td class="align-center">**Backend**</td><td class="align-center">**Provider Name**</td><td class="align-center">**ShortName**</td></tr><tr><td>PostgreSQL</td><td>PostGreSQL</td><td>postgres</td></tr><tr><td>SQL Server</td><td>SQLServer</td><td>sqlserver</td></tr><tr><td>In Memory</td><td>InMemory</td><td>inmem</td></tr><tr><td>SQLite</td><td>SQLite</td><td>sqlite</td></tr></tbody></table>

#### Examples

Here's an example of how to decorate a Postgres data context:

```c#
[DataContext("PostGreSQL", "postgres", "PostGresDatabase")]
public class Postgres_TestDbContext : TestDbContext
{
}
```

Here's an example of how to decorate a SQL Server data context:

```c#
[DataContext("SQLServer", "sqlserver", "sqlserverDatabase")]
public class SQLServer_TestDbContext : TestDbContext
{
}
```

Here's an example of how to decorate a SQLite data context:

```c#
[DataContext("SQLite", "sqlite", "SQLiteDatabase")]
public class SQLite_TestDbContext : TestDbContext
{
}
```

Here's an example of how to decorate a Postgres data context:

```c#
[DataContext("InMemory", "inmem", "InMemoryDatabase")]
public class InMem_TestDbContext : TestDbContext
{
}
```