Is it possible to use a lambda expression inside an object initialization expression? Please look at the code below:
XDocument doc = new XDocument(
new XDeclaration("1.0", "utf-8", "yes"),
new XElement("data",
new XElement("album",
new XElement("slide1"),
new XElement("slide2"),
new XElement("slide3")
)
)
);
instead of...
new XElement("slide1"),
new XElement("slide2"),
new XElement("slide3")
...I want to use a lamda expression which returns XElement[]
Thanks for help!