private void interfaceLinqXElement() { Console.WriteLine(); Console.WriteLine("Reading XML > Read using LINQ and XElement Class"); Console.WriteLine("================================================"); Console.WriteLine("1. Select XPath (Single)"); Console.WriteLine("2. Select LINQ (Single)"); Console.WriteLine("3. Select XPath (Multiple)"); Console.WriteLine("4. Select LINQ (Multiple)"); var input = Console.ReadLine(); switch (input) { case "1": LinqXElementHelper.GetInstance().SelectSingleXPath(); break; case "2": LinqXElementHelper.GetInstance().SelectSingleLinq(); break; case "3": LinqXElementHelper.GetInstance().SelectMultipleXPath(); break; case "4": LinqXElementHelper.GetInstance().SelectMultipleLinq(); break; } }
private void interfaceLinqXElement() { Console.WriteLine("Writing XML > Write using XDocument Class"); Console.WriteLine("==========="); Console.WriteLine("1. Write XDocument"); Console.WriteLine("2. Write XElement"); Console.WriteLine("3. Add Element using Constructor"); Console.WriteLine("4. Add Element by Cloning"); Console.WriteLine("5. Update Element"); Console.WriteLine("6. Delete Element"); Console.Write("Select: "); var input = Console.ReadLine(); switch (input) { case "1": LinqXElementHelper.GetInstance().WriteXDocument(); break; case "2": LinqXElementHelper.GetInstance().WriteXElement(); break; case "3": LinqXElementHelper.GetInstance().AddElementConstructor(); break; case "4": LinqXElementHelper.GetInstance().AddElementCloning(); break; case "5": LinqXElementHelper.GetInstance().UpdateElement(); break; case "6": LinqXElementHelper.GetInstance().DeleteElement(); break; } }