dotnet ef may not find TickerNetDbContext without a design-time factory

Offen
#75 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@harryhawwy69 arbeitet bereits daran.

Seit 24.11.2026.

  • #84 von @harryhawwy69 — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
40/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
csharp
Bereich
backend, databases

Rechercherichtung

Start in src/TickerNet.EntityFrameworkCore/Customizer/CustomizerServiceDescriptor.cs around lines 38-46, where only IDbContextFactory<TContext> and a scoped TContext are registered. Reproduce in a sample using TickerNet's own context: run dotnet ef dbcontext list and confirm the context is missing, then register DbContextOptions<TContext> (or call AddDbContext alongside the factory). Add a test that fails before the change and wire the dotnet ef dbcontext list check into CI for that sample. Open PR #84 already targets this issue, so coordinate before starting.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

.NET bug

What happens

dotnet ef migrations add probably can't find TickerNetDbContext when TickerNet uses its own context, unless the app adds a design-time factory.

CustomizerServiceDescriptor (src/TickerNet.EntityFrameworkCore/Customizer/CustomizerServiceDescriptor.cs, around lines 38-46) registers only IDbContextFactory<TContext> and a scoped TContext. The EF Core tools find contexts through registered DbContextOptions<TContext>, which AddDbContext used to register before it was replaced.

To confirm

Run dotnet ef dbcontext list in a sample that uses TickerNet's own context. If it isn't listed, register DbContextOptions<TContext> as well (or use AddDbContext next to the factory), and add the command to CI for that sample.


Found while checking which problems that TickerQ fixed after the fork still exist in TickerNet. Fix it from this description and TickerNet's own code only: never read or copy code from TickerQ 10.5.0 or later (see CONTRIBUTING.md). Please add a test that fails before the fix.

Vorherrschende Sprache
C#
Sterne
0
Forks
2
Ø Merge
1 Std. 8 Min.
Gemergte PRs (30 T.)
24

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TickerNet/TickerNet

Alle Issues in TickerNet/TickerNet

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.