Exemplo n.º 1
0
        public void can_store()
        {
            var model = new SampleReadModelWithStringKey()
            {
                Id = "a"
            };

            _inmemoryCollection.Save(model);
            Assert.AreEqual(1, _inmemoryCollection.GetAll().Count());
        }
Exemplo n.º 2
0
 public void EnsureIndex(string propertyName)
 {
     if (!base.ContainsKey(propertyName))
     {
         var index = new Index(propertyName);
         base[propertyName] = index;
         foreach (var element in _collection.GetAll())
         {
             index.Set(element);
         }
     }
 }
Exemplo n.º 3
0
 public IQueryable <TModel> Where(Expression <Func <TModel, bool> > filter)
 {
     return(_inmemoryCollection.IsActive ?
            _inmemoryCollection.GetAll().Where(filter).ToArray().AsQueryable() :
            _storage.Where(filter));
 }