.NET and ASP.NET Core 10 · Entity Framework Core

Register a DbContext

Add Entity Framework Core with PostgreSQL to dependency injection.

builder.Services.AddDbContext<AppDbContext>(options =>
    options.UseNpgsql(builder.Configuration.GetConnectionString("Default")));

Official .NET and ASP.NET Core 10 documentation

More entity framework core commands

All entity framework core commands · .NET and ASP.NET Core 10 cheatsheet

Was this page helpful?