Is it bad practice to just use UriKind.RelativeOrAbsolute?

Are there any flaws for ALWAYS using UriKind.RelativeOrAbsolute (C # / Silverlight), besides some slight performance loss, instead of checking whether or not the path is correct and using the correct UriKind?

Uri nav = new Uri(path, UriKind.RelativeOrAbsolute); 

Otherwise: using the code above, is there ever a time when it will be evaluated as a relative path, when should it be evaluated as an absolute path? Is one checked against the other? Is it possible that the path will satisfactorily be the relative path && the absolute path?

+4
source share
1 answer

I found a really interesting video and some descriptions below

Yo can get through

uri Kind Desc

This text is part of the description. Please go through this. I hope this clears up your concept.

But what about UriKind.RelativeOrAbsolute? This is a little trickier. The best I can understand is that we just ask the runtime to show it on its own. He will try to clear the UriString that we provide and find out where the resources are.

0
source

Source: https://habr.com/ru/post/1501682/


All Articles