Skip to content

Commit

Permalink
Merge pull request #69 from codymullins/patch-1
Browse files Browse the repository at this point in the history
Update README.md with DbContext pooling instructions
  • Loading branch information
Giorgi authored Feb 1, 2024
2 parents 2e4a2d2 + a808114 commit 1f9a68b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,14 @@ using (var demoContext = new DemoContext())
}
}
```

### Usage with DbContext pooling

Instead of calling `UseExceptionProcessor` in the `OnConfiguring` method, add it where you add your `DbContextPool`:

```csharp
// Replace UseNpgsql with the sql flavor you're using
builder.Services.AddDbContextPool<DemoContext>(options => options
.UseNpgsql(config.GetConnectionString("DemoConnection"))
.UseExceptionProcessor());
```

0 comments on commit 1f9a68b

Please sign in to comment.