public ThreadStatsRethinkDbService(IRethinkDbSingletonProvider rethinkDbSingletonProvider)
        {
            if (rethinkDbSingletonProvider == null)
            {
                throw new ArgumentNullException(nameof(rethinkDbSingletonProvider));
            }

            _rethinkDbSingleton  = rethinkDbSingletonProvider.RethinkDbSingleton;
            _rethinkDbConnection = rethinkDbSingletonProvider.RethinkDbConnection;
        }
Exemplo n.º 2
0
        public static List <string> GetIds(RethinkDb.Driver.RethinkDB R, RethinkDb.Driver.Net.Connection connection)
        {
            Cursor <object> cursor = R.Db(DatabaseName).Table(TableName).Pluck("id").RunCursor <object>(connection);
            String          json   = "";

            cursor.BufferedItems.ForEach(item => json += item + ",\n");
            json = json.TrimEnd(',', '\n');
            json = "[" + json + "]";

            List <ID>     ids  = new List <ID>(JsonConvert.DeserializeObject <IEnumerable <ID> >(json));
            List <string> _ids = new List <string>();

            ids.ForEach(id => _ids.Add(id.id));
            return(_ids);
        }