public SwagWindowSettingService(SwagContext context, SwagWindowSettingsGroupRepository swagWindowSettingGroupRepository, SwagSettingGroupRepository swagSettingGroupRepository) { _context = context; _swagWindowSettingsGroupRepository = swagWindowSettingGroupRepository; _swagSettingGroupRepository = swagSettingGroupRepository; }
private static void ConfigureServices() { var services = new ServiceCollection(); //services.AddDbContext<SwagWPFContext>(options => SwagContext.SetSqliteOptions(options)); services.AddDbContext <SwagContext, SwagWPFContext>(options => SwagContext.SetSqliteOptions(options)); //services.AddDbContext<SwagContext>(options => SwagContext.SetSqlServerOptions(options)); services.AddTransient <SwagWindowSettingsGroupRepository>(); services.AddTransient <SwagSettingGroupRepository>(); services.AddSingleton <SwagWindowSettingService>(); services.AddTransient <ISwagDataRepository, SwagDataRepository>(); services.AddTransient <SwagDataService>(); services.AddSingleton <IJsonConverterProviderService, JsonConverterProviderServiceWPF>(); services.AddSingleton <IJObjectToIconEnumService, JObjectToIconEnumServiceWPF>(); _serviceProvider = services.BuildServiceProvider(); }
public SwagDataService(SwagContext context, ISwagDataRepository swagDataRepository) { _context = context; _swagDataRepository = swagDataRepository; }