You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
CosmosLinqQuery.ToString() returns the relative Uri of the queried container if the CosmosLinqQuery expression is an empty query. For instance, when getting the queryable object from container.GetItemLinqQueryable().
In V2 SDK, DocumentQuery.ToString() returns the absolute Uri of the queried container/collection.
Actual behavior
In V3 code, queryableString returns:
"dbs/databaseName/colls/collectionName"
Environment summary
SDK Version: Latest
OS Version (e.g. Windows, Linux, MacOSX): Windows
Additional context
In the rare case where an app checks if the "empty" queryable object's string is an absolute Uri before performing specific actions, it could behave differently when migrating to V3 and the string returns a relative Uri. Sample:
if (Uri.TryCreate(queryableString, UriKind.Absolute, out Uri uri))
{
// run specific actions
}
For my V3 migrated service, I was able to resolve and maintain the behavior by simply checking if the Uri is UriKind.RelativeOrAbsolute instead of UriKind.Absolute.
The text was updated successfully, but these errors were encountered:
Describe the bug
CosmosLinqQuery.ToString() returns the relative Uri of the queried container if the CosmosLinqQuery expression is an empty query. For instance, when getting the queryable object from
container.GetItemLinqQueryable()
.In V2 SDK, DocumentQuery.ToString() returns the absolute Uri of the queried container/collection.
To Reproduce
Sample V3 code:
Expected behavior
In V2 similar code, the queryable.ToString() returns an absolute Uri of the container/collection:
"https://[host]:[port]/dbs/databaseName/colls/collectionName"
Actual behavior
In V3 code, queryableString returns:
"dbs/databaseName/colls/collectionName"
Environment summary
SDK Version: Latest
OS Version (e.g. Windows, Linux, MacOSX): Windows
Additional context
In the rare case where an app checks if the "empty" queryable object's string is an absolute Uri before performing specific actions, it could behave differently when migrating to V3 and the string returns a relative Uri. Sample:
For my V3 migrated service, I was able to resolve and maintain the behavior by simply checking if the Uri is
UriKind.RelativeOrAbsolute
instead ofUriKind.Absolute
.The text was updated successfully, but these errors were encountered: