public void ConfigureServices(IServiceCollection services) { var policySetDbConnStr = Configuration.GetConnectionString($"{ServiceName}DbConnection"); services.AddDbContext <IGroupDbContext, PolicySetDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, policySetDbConnStr)); services.AddDbContext <ILoginDbContext, PolicySetDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, policySetDbConnStr)); services.AddDbContext <IPolicyDbContext, PolicySetDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, policySetDbConnStr)); services.AddDbContext <IPolicySetDbContext, PolicySetDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, policySetDbConnStr)); services.AddScoped(typeof(IGroupRepository), typeof(GroupRepository)); services.AddScoped(typeof(ILoginRepository), typeof(LoginRepository)); services.AddScoped(typeof(IPolicyRepository), typeof(PolicyRepository)); services.AddScoped(typeof(IPolicySetRepository), typeof(PolicySetRepository)); services.AddControllers(); services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new OpenApiInfo { Title = $"{ServiceName} HTTP API", Version = "v1", Description = ServiceName }); }); }
public void ConfigureServices(IServiceCollection services) { var loginDevicesDbConnStr = Configuration.GetConnectionString($"{ServiceName}DbConnection"); services.AddDbContext <IGroupDbContext, LoginDevicesDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, loginDevicesDbConnStr)); services.AddDbContext <IUserDbContext, LoginDevicesDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, loginDevicesDbConnStr)); services.AddDbContext <ILoginDbContext, LoginDevicesDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, loginDevicesDbConnStr)); services.AddDbContext <IDevicePlatformDbContext, LoginDevicesDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, loginDevicesDbConnStr)); services.AddDbContext <IDeviceDbContext, LoginDevicesDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, loginDevicesDbConnStr)); services.AddDbContext <ILoginDevicesDbContext, LoginDevicesDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, loginDevicesDbConnStr)); services.AddScoped(typeof(IGroupRepository), typeof(GroupRepository)); services.AddScoped(typeof(ILoginRepository), typeof(LoginRepository)); services.AddScoped(typeof(IUserRepository), typeof(UserRepository)); services.AddScoped(typeof(IDevicePlatformRepository), typeof(DevicePlatformRepository)); services.AddScoped(typeof(IDeviceRepository), typeof(DeviceRepository)); services.AddScoped(typeof(ILoginDevicesRepository), typeof(LoginDevicesRepository)); services.AddControllers(); services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new OpenApiInfo { Title = $"{ServiceName} HTTP API", Version = "v1", Description = ServiceName }); }); }
public void ConfigureServices(IServiceCollection services) { var actionLogDbConnStr = Configuration.GetConnectionString($"{ServiceName}DbConnection"); services.AddDbContext <IActionLogDbContext, ActionLogDbContext>(options => BaseDbContextOptions.CreateDbContextOptionsAction(options, actionLogDbConnStr)); services.AddScoped(typeof(IActionLogRepository), typeof(ActionLogRepository)); services.AddControllers(); services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new OpenApiInfo { Title = $"{ServiceName} HTTP API", Version = "v1", Description = ServiceName }); }); }