Description
With the URI type is serialized to string, you can only do direct comparison (equal/not equal) whereas in C#, the type has various more properties like scheme, host, path etc. Because of this, you can't do many useful queries against this type, making it kinda useless to even support serialization of the Uri type.
For example, take the following class:
class ExampleClass |
{
|
public string Id { get; set; } |
public Uri WebsiteUri { get; set; } |
}
|
I can't query it like:
myCollection.AsQueryable().Where(e => e.WebsiteUri.Host == "somedomain.com"); |
Because
InvalidOperationException: {document}{WebsiteUri}.Host is not supported.
|
I can only do this:
myCollection.AsQueryable().Where(e => e.WebsiteUri == new Uri("http://somedomain.com/some-page")); |