Skip to content

Commit

Permalink
Add an SQL database
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Sep 27, 2023
1 parent 03346c0 commit 2b2018a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/University/HostingExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.UI;
using Microsoft.IdentityModel.Logging;
using Serilog;
using University.Service;

namespace University;

Expand All @@ -14,6 +17,9 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
var configuration = builder.Configuration;
_env = builder.Environment;

services.AddDbContext<UniversityDbContext>(options =>
options.UseSqlServer(configuration.GetConnectionString("DefaultConnection")));

services.Configure<TrinsicOptions>(options =>
configuration.Bind(TrinsicOptions.Trinsic, options));

Expand All @@ -35,7 +41,7 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
{
options.FallbackPolicy = options.DefaultPolicy;
});

services.AddRazorPages()
.AddMicrosoftIdentityUI();

Expand Down
3 changes: 2 additions & 1 deletion src/University/Service/DiplomaTemplate.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace University.Service;

public class DiplomaTemplate
{
[Key]
public int Id { get; set; }
public string TemplateId { get; set; } = string.Empty;
public string SchemaUri { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
}
3 changes: 3 additions & 0 deletions src/University/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// "Ecosystem": "--in-your-user-secrets--",
// "ApiKey": "--in-your-user-secrets--"
//},
"ConnectionStrings": {
"DefaultConnection": "Data Source=.;Initial Catalog=UniversitySsi;Integrated Security=True;TrustServerCertificate=True;"
},
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "damienbodsharepoint.onmicrosoft.com",
Expand Down

0 comments on commit 2b2018a

Please sign in to comment.