我正在使用UnitOfWork模式并且它工作得很好但是因为我需要使用 UserManager 和 SinginManager 我必须将此部分添加到startup.cs
services.AddDbContext<MainDbContext>(p => p.UseSqlServer(
@"Data Source="));
但是由于我使用的是UnitOfWork我也添加了这些行;
services.AddScoped<IUnitOfWork<MainDbContext>, UnitOfWork<MainDbContext>>();
services.AddScoped<IUnitOfWork<FinancialDbContext>, UnitOfWork<FinancialDbContext>>();
在startup.cs中注入和激活两种方式都可以吗?