Exemple #1
0
        public void Insert()
        {
            foreach (var doc in Helper.GetDocs(_count))
            {
                var v = new TestDoc
                {
                    id    = doc["_id"].AsInt32,
                    name  = doc["name"].AsString,
                    lorem = doc["lorem"].AsString
                };

                dict.TryAdd(v.id, v);
            }
        }
Exemple #2
0
        public IEnumerable <TestDoc> MakeDoc()
        {
            foreach (var doc in Helper.GetDocs(_count))
            {
                var v = new TestDoc
                {
                    id    = doc["_id"].AsInt32,
                    name  = doc["name"].AsString,
                    lorem = doc["lorem"].AsString
                };

                yield return(v);
            }
        }
Exemple #3
0
        public void Insert()
        {
            var builder = ImmutableDictionary.CreateBuilder <int, TestDoc>();

            foreach (var doc in Helper.GetDocs(_count))
            {
                var v = new TestDoc
                {
                    id    = doc["_id"].AsInt32,
                    name  = doc["name"].AsString,
                    lorem = doc["lorem"].AsString
                };

                builder.Add(v.id, v);
            }

            dict = builder.ToImmutableDictionary();
        }