Hello, I'm getting this error, I don't understand why
CodePudding user response:
You are registering DbContext
but resolving DbContexts
. Change registration to:
builder.AddDbContext<DbContexts>(...)
To prevent such typos from happening give your contexts meaningful names (and all classes in general). At least AppDbContext
but better something like RestaurantDbContext
or something related to domain that this context will represent/store.