I try add
using SciEn.Repo.Contracts;
using SciEn.Repo.IRepository;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddSingleton<ISubDepartmentRepository, SubDepartmentRepository>();
var app = builder.Build();
I got this error
'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: SciEn.Repo.Contracts.ISubDepartmentRepository Lifetime: Scoped ImplementationType: SciEn.Repo.IRepository.SubDepartmentRepository': Unable to resolve service for type 'SciEn.Models.ScinceContext' while attempting to activate 'SciEn.Repo.IRepository.SubDepartmentRepository'.)'
I try remove
builder.Services.AddScoped<ISubDepartmentRepository, SubDepartmentRepository>();
but get error
InvalidOperationException: Unable to resolve service for type "" while attempting to activate