コード例 #1
0
ファイル: RocksDbContext.cs プロジェクト: shargon/neo-sharp
        public RocksDbContext(RocksDbConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            // Initialize RocksDB (Connection String is the path to use)
            var options = new DbOptions().SetCreateIfMissing();

            // TODO #358: please avoid sync IO in constructor -> Open connection with the first operation for now
            _rocksDb = RocksDb.Open(options, config.FilePath);
        }
コード例 #2
0
 public static void Bind(this IConfiguration config, RocksDbConfig rocksDbConfig)
 {
     rocksDbConfig.FilePath = ParseString(config.GetSection("rocksDbProvider"), "filePath");
 }