Web Development
ASP.NET Core 10 & PostgreSQL Enterprise Architecture
Total: 480 mins My Learning

Setting up PostgreSQL Connection Strings and EF Core Npgsql

Type: Article 15 mins
Lesson Reference Guide
# PostgreSQL Setup Guide

To configure Npgsql with Entity Framework Core in ASP.NET Core, follow these configuration guidelines:

```json
{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Database=CodebaytDb;Username=postgres;Password=yourpassword"
}
}
```

In `Program.cs`:
```csharp
builder.Services.AddDbContext(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
```