CoreStrings.DbContextMissingConstructor(Object) Method

Definition

'AddDbContext' was called with configuration, but the context type '{contextType}' only declares a parameterless constructor. This means that the configuration passed to 'AddDbContext' will never be used. If configuration is passed to 'AddDbContext', then '{contextType}' should declare a constructor that accepts a DbContextOptions<{contextType}> and must pass it to the base constructor for DbContext.

C#
public static string DbContextMissingConstructor (object contextType);
C#
public static string DbContextMissingConstructor (object? contextType);

Parameters

contextType
Object

Returns

Applies to

Product Versions
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0