Ejemplo n.º 1
0
 public JsonProductRepository(JsonStorageSettings jsonSettings, IJsonTextWriterFactory jsonTextWriterFactory)
 {
     _jsonSettings          = jsonSettings;
     _jsonTextWriterFactory = jsonTextWriterFactory;
 }
 public ProductRepositoryFactory(IOptionsMonitor <DatabaseSettings> databaseSettings, IMongoDatabaseFactory mongoDatabaseFactory, IJsonTextWriterFactory jsonTextWriterFactory)
 {
     _dicInstances = new Dictionary <RepositoryType, IProductRepository>()
     {
         { RepositoryType.Json, new JsonProductRepository(databaseSettings.CurrentValue.JsonSettings, jsonTextWriterFactory) },
         { RepositoryType.MongoDb, new MongoProductRepository(databaseSettings.CurrentValue.MongoSettings, mongoDatabaseFactory) }
     };
     _databaseSettings = databaseSettings;
 }