Skip to content

Commit 08e00f1

Browse files
author
Sam
committed
added documentation paragraph.
1 parent 3a4c675 commit 08e00f1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

doc/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ title: Entity Framework 6
66
Npgsql has an Entity Framework 6 provider. You can use it by installing the
77
[EntityFramework6.Npgsql](https://www.nuget.org/packages/EntityFramework6.Npgsql/) nuget.
88

9+
## Basic Usage ##
10+
Create an inheritor if DbConfiguration in the same assembly as your entity framework DbContext. Ensure that you configure provider services, a provider factory, a default connection factory as shown below:
11+
12+
```
13+
class NpgSqlConfiguration : DbConfiguration
14+
{
15+
public NpgSqlConfiguration()
16+
{
17+
SetProviderFactory("Npgsql", NpgsqlFactory.Instance);
18+
SetProviderServices("Npgsql", provider: NpgsqlServices.Instance);
19+
SetDefaultConnectionFactory(new NpgsqlConnectionFactory());
20+
}
21+
}
22+
```
23+
924
## Guid Support ##
1025

1126
Npgsql EF migrations support uses `uuid_generate_v4()` function to generate guids.

0 commit comments

Comments
 (0)