public static void PrintXML(string fileName)
      {
          var XMLList = XMLSerializable.LoadAsXML(fileName);

          foreach (var book in XMLList)
          {
              Console.WriteLine($"{book.BookId}, {book.Title}");
          }
      }
Exemple #2
0
        static void Main(string[] args)
        {
            Library2 library = new Library2();

            Database.InsertBook("rata", new Publisher(2), 1111, 11);

            Database.DeleteBook(39);

            List <Book> books = Database.ListBooks();

            Database.PrintBooks(books);

            XMLSerializable.SaveAsXML("XMLFile.xml", books);

            SerializationJson.SaveAsJson("XMLFile.json", books);


            Console.ReadKey();
        }