public Uri GetValueAsUri()
Public Function GetValueAsUri As Uri
public:
Uri^ GetValueAsUri()
member GetValueAsUri : unit -> Uri
It turns out that we can't trust vendors to add only valid URLs to their records, for instance the iPhone has an attribute with value "www.apple.com" which isn't a URL as it has no scheme part (http://) etc.
Thus a Url value in an element can be stored in a number of formats. If created by the parser then it will be stored as a String or as an array of Byte if property ServiceRecordParser.LazyUrlCreation is set. If created locally it can be those types or also Uri .
This method will try to convert from those formats to Uri. If the URL is invalid e.g. has bad characters or is missing the scheme part etc then an error will occur. One can instead access the element's Value property and expect one of the three types. When created by the parser it will be of type String unless LazyUrlCreation is set.
InvalidOperationException | The service element is not of type ElementType.Url. |