Click or drag to resize
XmlExtensionMethodsGetOptionalAttributeT Method (XmlReader, String, FuncString, T, T)
Gets the value of an optional attribute. If the attribute isn't present, defaultValue is returned.

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.1.0.0 (5.1.0)
Syntax
public static T GetOptionalAttribute<T>(
	this XmlReader reader,
	string attributeName,
	Func<string, T> conversionFunc,
	T defaultValue
)

Parameters

reader
Type: System.XmlXmlReader
The reader.
attributeName
Type: SystemString
Name of the attribute.
conversionFunc
Type: SystemFuncString, T
The conversion func.
defaultValue
Type: T
The default value.

Type Parameters

T

Return Value

Type: T

Usage 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