From 0de65b89c406169bd9972887b1d62a4cc3fdf000 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 6 May 2021 20:13:21 +0300 Subject: Added simple User and Role DB classes, added a simple DBContext and configured it for PostgreSQL --- ExamTemplate/Web/Startup.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ExamTemplate/Web/Startup.cs') diff --git a/ExamTemplate/Web/Startup.cs b/ExamTemplate/Web/Startup.cs index 007f311..d6635b8 100644 --- a/ExamTemplate/Web/Startup.cs +++ b/ExamTemplate/Web/Startup.cs @@ -1,5 +1,7 @@ +using ExamTemplate.Data; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -19,6 +21,10 @@ namespace Web public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); + + // Database configuration + services.AddDbContext(options => + options.UseNpgsql(this.Configuration.GetConnectionString("LocalDBConnection"))); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. -- cgit v1.2.3