aboutsummaryrefslogtreecommitdiff
path: root/ExamTemplate/Web
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-05-06 20:13:21 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-05-06 20:13:21 +0300
commit0de65b89c406169bd9972887b1d62a4cc3fdf000 (patch)
treead07138de80f2f5fe241dcae48c9d28a5eeccb96 /ExamTemplate/Web
parent985d0a6f6dcfffaa227c117aaa184b4846009c0a (diff)
downloadit-kariera-exam-template-0de65b89c406169bd9972887b1d62a4cc3fdf000.tar
it-kariera-exam-template-0de65b89c406169bd9972887b1d62a4cc3fdf000.tar.gz
it-kariera-exam-template-0de65b89c406169bd9972887b1d62a4cc3fdf000.zip
Added simple User and Role DB classes, added a simple DBContext and configured it for PostgreSQL
Diffstat (limited to 'ExamTemplate/Web')
-rw-r--r--ExamTemplate/Web/Startup.cs6
-rw-r--r--ExamTemplate/Web/appsettings.Development.json9
-rw-r--r--ExamTemplate/Web/appsettings.json3
3 files changed, 9 insertions, 9 deletions
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<TemplateContext>(options =>
+ options.UseNpgsql(this.Configuration.GetConnectionString("LocalDBConnection")));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
diff --git a/ExamTemplate/Web/appsettings.Development.json b/ExamTemplate/Web/appsettings.Development.json
deleted file mode 100644
index dba68eb..0000000
--- a/ExamTemplate/Web/appsettings.Development.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft": "Warning",
- "Microsoft.Hosting.Lifetime": "Information"
- }
- }
-}
diff --git a/ExamTemplate/Web/appsettings.json b/ExamTemplate/Web/appsettings.json
index 81ff877..f49d9ab 100644
--- a/ExamTemplate/Web/appsettings.json
+++ b/ExamTemplate/Web/appsettings.json
@@ -1,4 +1,7 @@
{
+ "ConnectionStrings": {
+ "LocalDBConnection": "Server=localhost;Port=5432;Database=TemplateContext;User Id=;Password=;"
+ },
"Logging": {
"LogLevel": {
"Default": "Information",