コード例 #1
0
      public static void PrintXML(string fileName)
      {
          var XMLList = XMLSerializable.LoadAsXML(fileName);

          foreach (var book in XMLList)
          {
              Console.WriteLine($"{book.BookId}, {book.Title}");
          }
      }
コード例 #2
0
ファイル: Program.cs プロジェクト: irimiamihai91/week06
        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();
        }