Ejemplo n.º 1
0
        public LiteDbAccountDataRepository(
            string pathToDb,
            SecureString password,
            ICurrencies currencies,
            Network network)
        {
            _pathToDb = pathToDb ??
                        throw new ArgumentNullException(nameof(pathToDb));

            if (password == null)
            {
                throw new ArgumentNullException(nameof(password));
            }

            if (currencies == null)
            {
                throw new ArgumentNullException(nameof(currencies));
            }

            _sessionPassword = SessionPasswordHelper.GetSessionPassword(password);
            _bsonMapper      = CreateBsonMapper(currencies);

            LiteDbMigrationManager.Migrate(
                pathToDb: _pathToDb,
                sessionPassword: _sessionPassword,
                network: network);
        }
        public LiteDbAccountDataRepository(
            string pathToDb,
            SecureString password,
            ICurrencies currencies,
            ISymbols symbols)
        {
            _pathToDb = pathToDb ??
                        throw new ArgumentNullException(nameof(pathToDb));

            if (password == null)
            {
                throw new ArgumentNullException(nameof(password));
            }

            if (currencies == null)
            {
                throw new ArgumentNullException(nameof(currencies));
            }

            if (symbols == null)
            {
                throw new ArgumentNullException(nameof(symbols));
            }

            _sessionPassword = SessionPasswordHelper.GetSessionPassword(password);
            _bsonMapper      = CreateBsonMapper(currencies, symbols);
        }