XDocumentExtensions.

GetFirstElementValue(XDocument, XName, string, string) Method

Summary

gets the first matching element value, if a config is passed, it will only match an element with the specified config and platform condition. the platform defaults to AnyCPU

Syntax

public static string GetFirstElementValue(this XDocument document, XName elementName, string config = null, string platform = "AnyCPU")

Parameters

Name Type Description
document XDocument the document
elementName XName the element name to match
config string the configuration to match
platform string the platform to match, default is AnyCPU

Return Value

Type Description
string the matching element value if found