🗃️ created dbcontext
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
cc7bb34302
commit
f925b87883
3 changed files with 22 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
|
@ -7,6 +9,11 @@ builder.Services.AddControllers();
|
|||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
var configuration = builder.Configuration;
|
||||
|
||||
builder.Services.AddDbContext<MovieDbContext>(options =>
|
||||
options.UseNpgsql(configuration.GetConnectionString("DefaultConnection")));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
|
|
|||
Reference in a new issue