Home > Enterprise >  Some services are not able to be constructed (Error while validating the service descriptor 'Se
Some services are not able to be constructed (Error while validating the service descriptor 'Se

Time:06-29

enter image description here

enter image description here

enter image description here

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.

  • Related