Ejemplo n.º 1
0
 public BiggyList(IBiggyStore <T> store)
 {
     _store                = store;
     _queryableStore       = _store as IQueryableBiggyStore <T>;
     _updateableBiggyStore = _store as IUpdateableBiggyStore <T>;
     _items                = _store.Load();
 }
Ejemplo 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);
 }
Ejemplo 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;
 }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 9
0
 public Store()
 {
     _widgets           = new JsonStore <Widget>(dbName: "widgets");
     _updateableWidgets = _widgets as IUpdateableBiggyStore <Widget>;
     _queryableWidgets  = _widgets as IQueryableBiggyStore <Widget>;
 }
Ejemplo 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");
 }
Ejemplo n.º 11
0
 public QueryableBiggylist(IQueryableBiggyStore <T> store)
     : base(store)
 {
     _queryableStore = store;
 }
Ejemplo n.º 12
0
 public Store()
 {
     _widgets = new JsonStore<Widget>(dbName: "widgets");
       _updateableWidgets = _widgets as IUpdateableBiggyStore<Widget>;
       _queryableWidgets = _widgets as IQueryableBiggyStore<Widget>;
 }