Skip to content

Extend the XElement class with shortcut and extension methods #256

@hardcoder

Description

@hardcoder

Is your feature request related to a problem? Please describe.

  1. Using system derived namespace System.Xml.XPath, we can get elements by methods XPathSelectElement and XPathSelectElements.
    It is hard to read the code with tons of that methods, for example when parsing large Xml document.
  2. We cannot use local variables that store temporary XElement objects, in expressions, for example in AutoMapper mapping expression.
    Need to define Func<XElement,XElement> to use it in expressions.

Describe the solution you'd like

  1. Add shortcut extension methods for XElement methods:
  • "Get" for XPathSelectElement
  • "GetList" for XPathSelectElements
  1. Add extension method that will return Func<XElement, XElement>.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions