summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Program.cs b/Program.cs
index 48863a6..1e7b232 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,8 +1,12 @@
+using Microsoft.EntityFrameworkCore;
+using LibraryAPI.Models;
+
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
+builder.Services.AddDbContext<LibraryContext>(opt => opt.UseNpgsql(builder.Configuration.GetConnectionString("LibraryContext")));
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();