Adds Database Structure in C# with Entity Framework
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user