I tried any possible changes but could not able to solve this please if any one know about this help me out
Could not find any solution.
When I deleted identity it works properly, but when I add new scaffolded item, it shows the error mentioned.
I tried any possible changes but could not able to solve this please if any one know about this help me out
Could not find any solution.
When I deleted identity it works properly, but when I add new scaffolded item, it shows the error mentioned.
I tried any possible changes but could not able to solve this please if any one know about this help me out
Well, lets explain your error details:
As the error clearly describes that you have DataAccessLayer class file with your project which contains IUnitOfWork under the IRepositoty folder which you haven't register in your program.cs file as a result you have encountered that specific error.
Solution:
Resolve the current error, you have to register all the Interface and its Implementation just right before your var app = builder.Build();
So your AddScoped should be as following:
builder.Services.AddScoped<IUnitOfWork, UnitOfWork>();
builder.Services.AddScoped<IAnotherService, AnotherService>();
.... So on
Note: Point to keep in mind all the Interface and Implementation within your DataAccessLayer should be scopped before calling builder.Build()
DataAccessLayer with your Identity. By the way, could you please share your identity details and DataAccessLayer so that it would be more easier to assist you.
dataAccessLayerdetails? You have to register your repository in yourprogram.cswhilebuilding the appwhich is missing here.builder.Services.AddScoped<IUnitOfWork, UnitOfWork>();