IntelliTect / IntelliTect/TestTools

DatabaseFixture<T> does not support generic options

Offen
#91 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
C#
Sterne
10
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Reproduction steps:

Create context with a single constructor that takes in the generic DbContextOptions
```C#
public class BudgetContext : DbContext
{
public BudgetContext(DbContextOptions options)
: base(options)
{ }
}
```

Attempt to use the DatabaseFixture.
```C#
var fixture = new DatabaseFixture();

await fixture.PerformDatabaseOperation(async context =>
{
...
});
```

Observed:
System.InvalidOperationException: '***.BudgetContext' must contain a constructor that has a single parameter of type 'Microsoft.EntityFrameworkCore.DbContextOptions'

Expected:
I want my DbContext to take in the generic options overload.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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