示例#1
0
 public RepositoryFactory(IMongoDatabaseFactory dbFactory)
 {
     if (dbFactory == null)
     {
         throw new ArgumentNullException("dbFactory");
     }
     _dbFactory = dbFactory;
 }
 public MongoCollectionResolver([NotNull] ICacheKeyFactory cacheKeyFactory,
                                [NotNull] ICollectionCreator collectionCreator,
                                [NotNull] IMongoDatabaseFactory mongoDatabaseFactory)
 {
     if (cacheKeyFactory == null)
     {
         throw new ArgumentNullException(nameof(cacheKeyFactory));
     }
     if (collectionCreator == null)
     {
         throw new ArgumentNullException(nameof(collectionCreator));
     }
     if (mongoDatabaseFactory == null)
     {
         throw new ArgumentNullException(nameof(mongoDatabaseFactory));
     }
     _cacheKeyFactory      = cacheKeyFactory;
     _collectionCreator    = collectionCreator;
     _mongoDatabaseFactory = mongoDatabaseFactory;
 }
示例#3
0
        public MongoContext(IMongoConfigurationFactory configurationFactory,
                            IMongoClientFactory clientFactory,
                            IMongoDatabaseFactory databaseFactory,
                            IMongoCollectionFactory <Question> questionCollectionFactory,
                            IMongoCollectionFactory <Answer> answerCollectionFactory,
                            IMongoCollectionFactory <SearchTerm> searchTermCollectionFactory)
        {
            this.configurationFactory        = configurationFactory;
            this.clientFactory               = clientFactory;
            this.databaseFactory             = databaseFactory;
            this.questionCollectionFactory   = questionCollectionFactory;
            this.answerCollectionFactory     = answerCollectionFactory;
            this.searchTermCollectionFactory = searchTermCollectionFactory;

            configuration = configurationFactory.Create();
            var client = clientFactory.Create(configuration);

            database = databaseFactory.GetDatabase(configuration, client);

            EnforceTextIndexes();
        }
 public MedicationRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory
                       .GetDatabase()
                       .GetCollection <Medication>("medications");
 }
 public IdentityUserDal(IMongoDatabaseFactory databaseFactory) : base(databaseFactory)
 {
 }
示例#6
0
 public RepositoryFactory(IMongoDatabaseFactory databaseFactory)
 {
     this.databaseFactory = databaseFactory;
 }
 public PatientDetailsRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory
                       .GetDatabase()
                       .GetCollection <PatientDetail>("patientDetails");
 }
示例#8
0
 protected BaseDal(IMongoDatabaseFactory databaseFactory)
 {
     DatabaseFactory = databaseFactory;
 }
 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;
 }
 public IdentityRoleDal(IMongoDatabaseFactory databaseFactory) : base(databaseFactory)
 {
 }
示例#11
0
 public RecentPatientsRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory.GetDatabase()
                       .GetCollection <RecentPatient>("recentPatients");
 }
示例#12
0
 public MongoIndexBuilder(IMongoDatabaseFactory factory)
 {
     this.Database = factory.GetDatabase();
 }
 public ClinicalNoteRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory
                       .GetDatabase()
                       .GetCollection <ClinicalNote>("clinicalNotes");
 }
示例#14
0
 public MongoProductRepository(MongoSettings mongoSettings, IMongoDatabaseFactory mongoDatabaseFactory)
 {
     _db            = mongoDatabaseFactory.CreateInstance(mongoSettings.ConnectionString, mongoSettings.DatabaseName);
     _mongoSettings = mongoSettings;
 }
示例#15
0
 public AllergyRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory
                       .GetDatabase()
                       .GetCollection <Allergy>("allergies");
 }
示例#16
0
 public RecentModuleListsRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory.GetDatabase()
                       .GetCollection <RecentModulesList>("recentModulesLists");
 }
 public TestDal(IMongoDatabaseFactory databaseFactory) : base(databaseFactory)
 {
 }
示例#18
0
 public RepositorioFactory(IMongoDatabaseFactory dbFactory)
 {
     _dbFactory = dbFactory;
 }
示例#19
0
 public NotificationsRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory.GetDatabase()
                       .GetCollection <Notification>("notifications");
 }
示例#20
0
 public DiagnosisRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory
                       .GetDatabase()
                       .GetCollection <Diagnosis>("diagnoses");
 }
示例#21
0
 public ContactRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory
                       .GetDatabase()
                       .GetCollection <Contact>("contacts");
 }
示例#22
0
 public TestResultRepository(IMongoDatabaseFactory factory)
 {
     this.Collection = factory
                       .GetDatabase()
                       .GetCollection <TestResult>("testResults");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericMongoRepository"/> class.
 /// </summary>
 /// <param name="databaseFactory">The database factory.</param>
 /// <param name="optionsAccessor">The options accessor.</param>
 public GenericMongoRepository(IMongoDatabaseFactory databaseFactory, IOptions <MongoConfigurationOptions> optionsAccessor)
 {
     database = databaseFactory.Connect(optionsAccessor);
 }