Example #1
0
        //----< Demonstrate DB Augments >------------------------------------
        void TestAugment()
        {
            "Augmenting DB contents from persistFileT.xml".body();
            PersistEngine.augment <int, DBElement <int, string>, string>(db, "persistFileT.xml");
            WriteLine();


            "Augmenting DB contents from persistFile.xml".body();
            PersistEngine.augment <int, DBElement <int, string>, string>(db, "persistFile.xml");
            WriteLine();
        }
Example #2
0
        //----< Augment primitive type DB to XML file >-------------------------------------
        public static void augment <Key, Value, Data>(this DBEngine <Key, Value> db, string filename)
        {
            if (!File.Exists(filename))
            {
                "File does not exist!".error();  return;
            }
            XDocument xDocument = null;

            xDocument = XDocument.Load(filename);
            PersistEngine.FromXML <Key, Value, Data>(db, xDocument);
        }
Example #3
0
 //----< Demonstrate DB Persists >------------------------------------
 void TestPersist()
 {
     "Persisting DB contents to persistFile.xml".body();
     PersistEngine.persist <int, DBElement <int, string>, string>(db, "persistFile.xml");
     "Clearing DB contents after persist".body();
 }