Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
display xml : linq
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Xml; using System.Xml.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Book[] books = new Book[]{ new Book("Ajax in Action", "Manning", 2005), new Book("Windows Forms in Action", "Manning", 2006) }; //Build XML Fragment based on the Collection XElement xml = new XElement("books", from book in books where book.Year == 2006 select new XElement("book", new XAttribute("title", book.Title), new XElement("publisher", book.Publisher) )); // Dump the XML to the console Console.WriteLine(xml); } public class Book { public string Publisher; public string Title; public int Year; public Book(string title,string publisher,int year) { Title = title; Publisher = publisher; Year = year ; } } } }
run
|
edit
|
history
|
help
0
30272 Program Ex5 if_else2_odd_even
const
Rotate array to the right of a given pivot
Basma 2
value tuple
testing endpoint
math 10.98
s
Hello
Testing 001