Created
December 9, 2012 12:00
-
-
Save NIA/4244563 to your computer and use it in GitHub Desktop.
map syntax compared between Scala and C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "Scala": XElement.Load(xmlFileName).Descendants("element") map { _.Attribute(xmlAttribute).Value } | |
// Query syntax | |
items = from element in XElement.Load(xmlFileName).Descendants("element") select element.Attribute(xmlAttribute).Value; | |
// Extension method syntax | |
items = XElement.Load(xmlFileName).Descendants("element").Select( element => element.Attribute(xmlAttribute).Value); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment