Reusable db stuff??

This commit is contained in:
Lani Aung
2024-09-15 21:59:05 -06:00
parent 009efc4643
commit c805414cab
28 changed files with 71 additions and 32 deletions
@@ -1,6 +1,6 @@
@page "/"
<PageTitle>Home</PageTitle>
<PageTitle>Kisekae</PageTitle>
<h1>Hello, world!</h1>
+3
View File
@@ -1,10 +1,13 @@
using fxl.codes.kisekae.blazor.Components;
using fxl.codes.kisekae.data;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddDbContextFactory<KisekaeContext>(options => { options.UseNpgsql(builder.Configuration.GetConnectionString("kisekae")); });
var app = builder.Build();
+4 -1
View File
@@ -5,5 +5,8 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"ConnectionStrings": {
"kisekae": ""
}
}
@@ -6,4 +6,18 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageReference Include="Npgsql" Version="8.0.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\fxl.codes.kisekae.data\fxl.codes.kisekae.data.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Services\" />
</ItemGroup>
</Project>