Skip to content

DatabaseFixture<T> does not support generic options #91

@Keboo

Description

@Keboo

Reproduction steps:

Create context with a single constructor that takes in the generic DbContextOptions

public class BudgetContext : DbContext
{
    public BudgetContext(DbContextOptions<BudgetContext> options)
        : base(options)
    { }
}

Attempt to use the DatabaseFixture.

var fixture = new DatabaseFixture<BudgetContext>();

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions