Created
August 16, 2011 15:49
-
-
Save jrwren/1149398 to your computer and use it in GitHub Desktop.
why not have some helpful two way XElement, strings maps :)
This file contains 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
public static IEnumerable<System.Xml.Linq.XElement> ToXElement(this IEnumerable<string> source, string tag = "Value") | |
{ | |
return source.Select(s => new System.Xml.Linq.XElement(tag, s)); | |
} | |
public static IEnumerable<string> ToStrings(this System.Xml.Linq.XElement source, string tag = "Value") | |
{ | |
return source.Elements("Value").Select(e => (string)e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment