public Action<Message>persistDB(DBEngine<string, DBElement<string, List<string>>> db)
 {
     Action<Message> PersistDB = (msg) =>
        {
            StringAndStringList pe = new StringAndStringList(db);
            XDocument doc = XDocument.Parse(msg.content);
            string XmlFile = doc.Descendants("Msg").Descendants("Data").Descendants("FileName").ElementAt(0).Value;
            pe.writeToXML(XmlFile);
            msg.content = "Persist success";
            Console.Write("\n\n The database has been persisted");
            Utilities.swapUrls(ref msg);
        };
     return PersistDB;
 }
 public Action<Message> restoreDB(DBEngine<string, DBElement<string, List<string>>> db)
 {
     Action<Message> RestoreDB = (msg) =>
     {
         StringAndStringList pe = new StringAndStringList(db);
         XDocument doc = XDocument.Parse(msg.content);
         string XmlFile = doc.Descendants("Msg").Descendants("Data").Descendants("FileName").ElementAt(0).Value;
         pe.writeToXML(XmlFile);
         Console.Write("\n\n ---The database has been restored ---");
         pe.persistDB.showEnumerableDB();
         msg.content = "Restore success";
         Utilities.swapUrls(ref msg);
     };
     return RestoreDB;
 }