systemd integration

This commit is contained in:
Gwendolyn 2022-11-19 22:46:32 +01:00
parent 8bd61cd7ee
commit a27d8d5397
2 changed files with 3 additions and 1 deletions

View file

@ -9,7 +9,8 @@ public static class Program
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Host.UseSystemd();
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ??
throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContextFactory<AppDbContext>(options => options

View file

@ -14,6 +14,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="7.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="7.0.0" />
</ItemGroup>