public MongoGenericRepository(IMongoCollectionFactory factory, string collectionName) { Throw.IfNull(factory, nameof(factory)); Throw.IfNull(collectionName, nameof(collectionName)); _collection = factory.GetCollection <TMongoEntity>(collectionName); }
public CreatedCityWeatherForecastSearchListener( IOptions <HubMethods> options, IHubContext <WeatherHistoryHub> hubContext, IMongoCollectionFactory <WeatherHistoryConnection> mongoCollectionFactory) { _hubMethods = options.Value; _hubContext = hubContext; _weatherHistoryConnectionCollection = mongoCollectionFactory.Create(); }
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 CreateIconValidator(IMongoCollectionFactory <IconDocument> mongoCollectionFactory) { _iconCollection = mongoCollectionFactory.Create(); RuleFor(c => c.Name) .Cascade(CascadeMode.Stop) .Must(IsNotNullOrEmptyAndAtLeastOneNonWhiteCharacterLong).WithMessage("{PropertyName} should have at least 1 character that is not a white character") .MustAsync(async(name, cancellation) => await IsNameUnique(name, cancellation)).WithMessage("{PropertyName} must be unique"); RuleFor(c => c.Description) .Cascade(CascadeMode.Stop) .Must(IsNotNullOrEmptyAndAtLeastOneNonWhiteCharacterLong).WithMessage("{PropertyName} should have at least 1 character that is not a white character"); RuleFor(c => c.Icon) .Cascade(CascadeMode.Stop) .Must(IsNotNullOrEmptyAndAtLeastOneNonWhiteCharacterLong).WithMessage("{PropertyName} should have at least 1 character that is not a white character") .MustAsync(async(icon, cancellation) => await IsIconUnique(icon, cancellation)).WithMessage("{PropertyName} must be unique"); RuleFor(c => c.FileContent) .Cascade(CascadeMode.Continue) .NotNull().WithMessage("{PropertyName} can't be null") .NotEmpty().WithMessage("{PropertyName} can't be empty"); }
public MongoRepository(IMongoCollectionFactory <TMongoDocument> mongoCollectionFactory) { _mongoCollection = mongoCollectionFactory.Get(); }
public WorkbenchNodeRepository(IMongoCollectionFactory <WorkbenchNode> nodeCollectionFactory) { MongoCollection = nodeCollectionFactory.GetMongoCollection(collectionName); }
public WeatherHistoryHub(IMongoCollectionFactory <WeatherHistoryConnection> mongoCollectionFactory) { _weatherHistoryConnectionCollection = mongoCollectionFactory.Create(); }
public MongoDbHandler(IMongoCollectionFactory dbFactory) { _dbFactory = dbFactory; }
public CityWeatherForecastService(IMongoCollectionFactory <CityWeatherForecastDocument> mongoCollectionFactory) { _cityWeatherForecastCollection = mongoCollectionFactory.Create(); }