CoreStrings.DbContextMissingConstructor(Object) 方法

定义

“AddDbContext”是使用配置调用的,但上下文类型“{contextType}”仅声明无参数构造函数。 这意味着永远不会使用传递给“AddDbContext”的配置。 如果将配置传递给“AddDbContext”,则“{contextType}”应声明接受 DbContextOptions<{contextType}> 的构造函数,并且必须将其传递给 DbContext 的基本构造函数。

public static string DbContextMissingConstructor (object contextType);
public static string DbContextMissingConstructor (object? contextType);
static member DbContextMissingConstructor : obj -> string
Public Shared Function DbContextMissingConstructor (contextType As Object) As String

参数

contextType
Object

返回

适用于