XmlExtensionMethodsGetOptionalAttributeT Method (XmlReader, String, FuncString, T) |
Gets the value of an optional attribute. If the attribute isn't present, string.Empty is returned.
Namespace:
SD.LLBLGen.Pro.ORMSupportClasses
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.4.0.0 (5.4.0)
Syntax public static T GetOptionalAttribute<T>(
this XmlReader reader,
string attributeName,
Func<string, T> conversionFunc
)
<ExtensionAttribute>
Public Shared Function GetOptionalAttribute(Of T) (
reader As XmlReader,
attributeName As String,
conversionFunc As Func(Of String, T)
) As T
Parameters
- reader
- Type: System.XmlXmlReader
The reader. - attributeName
- Type: SystemString
Name of the attribute. - conversionFunc
- Type: SystemFuncString, T
The conversion func.
Type Parameters
- T
Return Value
Type:
TUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
XmlReader. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also