Kurse:Asp Net Core Übung 1: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
appsettings.json | |||
<pre> | |||
"ConnectionStrings": {"DefaultContext" : "Host=localhost;Port=5432;Database=thorsten;Username=thorsten;Password=Test" | |||
</pre> | |||
Program.cs | Program.cs | ||
<pre> | <pre> | ||
builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultContext"))); | builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultContext"))); | ||
</pre> | </pre> | ||
Version vom 17. Juli 2025, 01:34 Uhr
appsettings.json
"ConnectionStrings": {"DefaultContext" : "Host=localhost;Port=5432;Database=thorsten;Username=thorsten;Password=Test"
Program.cs
builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultContext")));