public ConvertModelsService()
        {
            var redis = RedisSettings.GetConnectionMultiplexer();

            _redisUsersDatabase  = redis.GetDatabase(0);
            _redisEventsDatabase = redis.GetDatabase(1);
        }
Example #2
0
        public ScopedService(IMongoSettings mongoSettings)
        {
            var client   = new MongoClient(mongoSettings.ConnectionString);
            var database = client.GetDatabase(mongoSettings.DatabaseName);

            _users  = database.GetCollection <BackendUserModel>("Users");
            _events = database.GetCollection <BackendEventModel>("Events");
            _cities = database.GetCollection <CityModel>("Cities");

            var redis = RedisSettings.GetConnectionMultiplexer();

            _redisUsersDatabase  = redis.GetDatabase(0);
            _redisEventsDatabase = redis.GetDatabase(1);
            _redisCitiesDatabase = redis.GetDatabase(2);
        }
        public CityService(IMongoSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _cities = database.GetCollection <CityModel>("Cities");
            _users  = database.GetCollection <UserModel>("Users");
            _events = database.GetCollection <EventModel>("Events");

            var redis = RedisSettings.GetConnectionMultiplexer();

            _redisUsersDatabase  = redis.GetDatabase(0);
            _redisEventsDatabase = redis.GetDatabase(1);
            _redisCitiesDatabase = redis.GetDatabase(2);
            _keys = redis.GetServer(_redisCitiesDatabase.Multiplexer.GetEndPoints().First()).Keys(2);
        }
Example #4
0
        public IdentityService(IJwtSettings jwtSettings, IMongoSettings settings
                               , ConvertModelsService convertModelsService)
        {
            _jwtSecret = jwtSettings.Secret;

            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _users = database.GetCollection <BackendUserModel>("Users");

            var redis = RedisSettings.GetConnectionMultiplexer();

            _redisUsersDatabase = redis.GetDatabase(0);

            _convertModelsService = convertModelsService;
        }
        public EventService(IMongoSettings settings, IHostingEnvironment hostingEnvironment
                            , ConvertModelsService convertModelsService)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _events             = database.GetCollection <BackendEventModel>("Events");
            _hostingEnvironment = hostingEnvironment;

            _users = database.GetCollection <BackendUserModel>("Users");

            var redis = RedisSettings.GetConnectionMultiplexer();

            _redisUsersDatabase  = redis.GetDatabase(0);
            _redisEventsDatabase = redis.GetDatabase(1);
            _keys = redis.GetServer(_redisEventsDatabase.Multiplexer.GetEndPoints().First()).Keys(1);

            _convertModelsService = convertModelsService;
        }