private void test2() { DBEngine <int, DBElement <int, string> > db = new DBEngine <int, DBElement <int, string> >(); DBEngine <string, DBElement <string, List <string> > > dbString = new DBEngine <string, DBElement <string, List <string> > >(); ItemFactory <int, string> itemFactory = new ItemFactory <int, string>(); //------------Search for Keys with pattern--------------------- "Search for keys with a pattern:".title('.'); WriteLine("\n\n Elements in DB :"); DBElement <string, List <string> > elemString = new DBElement <string, List <string> >(); elemString.name = "element"; elemString.descr = "test element"; elemString.timeStamp = DateTime.Now; elemString.children.AddRange(new List <string> { "Martin", "Nitish", "Michelle" }); elemString.payload = new List <string> { "elem's payload", "sample payload" }; dbString.insert("Name", elemString); DBElement <string, List <string> > elemString1 = new DBElement <string, List <string> >(); elemString1.name = "element"; elemString1.descr = "test element"; elemString1.timeStamp = DateTime.Now; elemString1.children.AddRange(new List <string> { "Syracuse", "Boston", "Mysore" }); elemString1.payload = new List <string> { "elem's payload", "sample payload" }; dbString.insert("Cities", elemString1); dbString.showEnumerableDB(); string keyPattern = "^C"; WriteLine("\n\nSearching for Keys with pattern: {0}\n", keyPattern); dynamic keys = dbString.searchForKeyPattern(keyPattern); WriteLine("\n\nMatched keys : \n"); foreach (var item in keys) { Write("{0}, ", item); } //------------Search for Keys with pattern--------------------- //------------Search for specified string in metadata--------------------- "Search for specified string in metadata:".title('.'); WriteLine("\n\n Elements in DB :"); db.showDB(); string searchString = "element3"; WriteLine("\n\n\nSearch string : {0}", searchString); WriteLine("\n\nSearching for specified string in metadata: \n\n", searchString); var matchedKeys = db.searchMetadata(searchString); foreach (var matchedKey in matchedKeys) { Write("{0}, ", matchedKey); } //------------Search for specified string in metadata--------------------- }