public void can_store() { var model = new SampleReadModelWithStringKey() { Id = "a" }; _inmemoryCollection.Save(model); Assert.AreEqual(1, _inmemoryCollection.GetAll().Count()); }
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); } } }
public IQueryable <TModel> Where(Expression <Func <TModel, bool> > filter) { return(_inmemoryCollection.IsActive ? _inmemoryCollection.GetAll().Where(filter).ToArray().AsQueryable() : _storage.Where(filter)); }