Пример #1
0
        public Versioner(ISession session, ILogger<Version> logger)
        {
            _logger = logger;
            _session = session;

            _logger.Debug("Define global mappings");
            lock (_registrationLock)
            {
                if (!_didRegisterMapping)
                {
                    MappingConfiguration.Global.Define<PocoMapper>();
                    _didRegisterMapping = true;
                }
            }

            _logger.Debug("Create mapper and table instances");
            _mapper = new global::Cassandra.Mapping.Mapper(_session);

            var table = new Table<DatabaseVersion>(_session);
            table.CreateIfNotExists();
        }
Пример #2
0
        public Versioner(ISession session, ILogger <Version> logger)
        {
            _logger  = logger;
            _session = session;

            _logger.Debug("Define global mappings");
            lock (_registrationLock)
            {
                if (!_didRegisterMapping)
                {
                    MappingConfiguration.Global.Define <PocoMapper>();
                    _didRegisterMapping = true;
                }
            }

            _logger.Debug("Create mapper and table instances");
            _mapper = new global::Cassandra.Mapping.Mapper(_session);

            var table = new Table <DatabaseVersion>(_session);

            table.CreateIfNotExists();
        }