Recently I created an API App for DocumentDB.
While testing it I kept getting errors about a invalid URI.
I was using System.Uri to create the collectionLink that is passed into
ExecuteStoredProcedureAsync<ListResults>(collectionLink, filterQuery, continuationToken);
The DocumentDB Client provides the UriFactory class, which is a helper class, that makes it easier to create the various Uris needed for use with the DocumentClient.
var collectionLink = UriFactory.CreateStoredProcedureUri(DocumentDbContext.DatabaseId, DocumentDbContext.CollectionId, DocumentDbContext.ProcedureId);
Using the UriFactory one can create links for the following:
- Document Collection
- Stored Procedure
- User Defined Function (UDF)