Exemplo n.º 1
0
 public BiggyList(IBiggyStore <T> store)
 {
     _store                = store;
     _queryableStore       = _store as IQueryableBiggyStore <T>;
     _updateableBiggyStore = _store as IUpdateableBiggyStore <T>;
     _items                = _store.Load();
 }
Exemplo n.º 2
0
 public LuceneStoreDecorator(IBiggyStore <T> biggyStore, bool useRamDirectory = false)
 {
     _biggyStore           = biggyStore;
     _queryableStore       = _biggyStore as IQueryableBiggyStore <T>;
     _updateableBiggyStore = _biggyStore as IUpdateableBiggyStore <T>;
     _luceneIndexer        = new LuceneIndexer <T>(useRamDirectory);
 }
Exemplo n.º 3
0
 public BiggyList(IBiggyStore <T> store, bool inMemory = false)
 {
     _store           = store;
     _queryableStore  = _store as IQueryableBiggyStore <T>;
     _updateableStore = _store as IUpdateableBiggyStore <T>;
     _items           = _store.Load();
     this.InMemory    = inMemory;
 }
Exemplo n.º 4
0
        public BiggyListWithFileDb()
        {
            // Set up the store for injection:
            _widgets           = new JsonStore <Widget>(dbName: "widgets");
            _updateableWidgets = _widgets as IUpdateableBiggyStore <Widget>;
            _queryableWidgets  = _widgets as IQueryableBiggyStore <Widget>;
            _widgets.Clear();

            _biggyWidgetList = new Biggy.BiggyList <Widget>(_widgets);
        }
Exemplo n.º 5
0
        public BiggyListWithFileDb()
        {
            // Set up the store for injection:
              _widgets = new JsonStore<Widget>(dbName: "widgets");
              _updateableWidgets = _widgets as IUpdateableBiggyStore<Widget>;
              _queryableWidgets = _widgets as IQueryableBiggyStore<Widget>;
              _widgets.Clear();

              _biggyWidgetList = new Biggy.BiggyList<Widget>(_widgets);
        }
Exemplo n.º 6
0
        public void IQueryableBiggyStore_Finds_Record()
        {
            _queryableStore = new SqlCeStore <Client>(_connectionStringName);
            var newClient = new Client()
            {
                LastName = "Atten", FirstName = "John", Email = "*****@*****.**"
            };

            _queryableStore.Add(newClient);
            var foundClient = _queryableStore.AsQueryable().FirstOrDefault(c => c.LastName == "Atten");

            Assert.True(foundClient.LastName == "Atten");
        }
        public BiggyListWithFileDbInMemory()
        {
            // Set up the store for injection:
              _widgetStore = new JsonStore<Widget>(dbName: "widgets");
              _updateableWidgets = _widgetStore as IUpdateableBiggyStore<Widget>;
              _queryableWidgets = _widgetStore as IQueryableBiggyStore<Widget>;
              _widgetStore.Clear();

              _biggyWidgetList = new Biggy.BiggyList<Widget>(_widgetStore);

              // Start with some data in a json file:
              var batch = new List<Widget>();
              for (int i = 0; i < INSERT_QTY; i++) {
            batch.Add(new Widget { SKU = string.Format("00{0}", i), Name = string.Format("Test widget {0}", i), Price = i });
              }
              _biggyWidgetList.Add(batch);
        }
Exemplo n.º 8
0
        public BiggyListWithFileDbInMemory()
        {
            // Set up the store for injection:
            _widgetStore       = new JsonStore <Widget>(dbName: "widgets");
            _updateableWidgets = _widgetStore as IUpdateableBiggyStore <Widget>;
            _queryableWidgets  = _widgetStore as IQueryableBiggyStore <Widget>;
            _widgetStore.Clear();

            _biggyWidgetList = new Biggy.BiggyList <Widget>(_widgetStore);

            // Start with some data in a json file:
            var batch = new List <Widget>();

            for (int i = 0; i < INSERT_QTY; i++)
            {
                batch.Add(new Widget {
                    SKU = string.Format("00{0}", i), Name = string.Format("Test widget {0}", i), Price = i
                });
            }
            _biggyWidgetList.Add(batch);
        }
Exemplo n.º 9
0
 public Store()
 {
     _widgets           = new JsonStore <Widget>(dbName: "widgets");
     _updateableWidgets = _widgets as IUpdateableBiggyStore <Widget>;
     _queryableWidgets  = _widgets as IQueryableBiggyStore <Widget>;
 }
Exemplo n.º 10
0
 public void IQueryableBiggyStore_Finds_Record()
 {
     _queryableStore = new PGStore<Client>(_connectionStringName);
       var newClient = new Client() { LastName = "Atten", FirstName = "John", Email = "*****@*****.**" };
       _queryableStore.Add(newClient);
       var foundClient = _queryableStore.AsQueryable().FirstOrDefault(c => c.LastName == "Atten");
       Assert.True(foundClient.LastName == "Atten");
 }
Exemplo n.º 11
0
 public QueryableBiggylist(IQueryableBiggyStore <T> store)
     : base(store)
 {
     _queryableStore = store;
 }
Exemplo n.º 12
0
 public Store()
 {
     _widgets = new JsonStore<Widget>(dbName: "widgets");
       _updateableWidgets = _widgets as IUpdateableBiggyStore<Widget>;
       _queryableWidgets = _widgets as IQueryableBiggyStore<Widget>;
 }