Adds Database Structure in C# with Entity Framework

This commit is contained in:
Henry Trumme
2025-04-22 00:59:47 +02:00
parent 370edc17e9
commit 1e6c7a47a4
71 changed files with 6197 additions and 140 deletions

View File

@@ -1,4 +1,7 @@
using WatchLog.Components;
using WatchLog.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
namespace WatchLog
{
@@ -8,10 +11,14 @@ namespace WatchLog
{
var builder = WebApplication.CreateBuilder(args);
var connectionString = builder.Configuration.GetConnectionString("WatchLogDB");
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddDbContextFactory<WatchLogDataContext>(options => options.UseSqlite(connectionString));
var app = builder.Build();
// Configure the HTTP request pipeline.