Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/DocumentDBRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public static async Task<T> GetItemAsync(string id, string category)
try
{
Document document =
await client.ReadDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id));
await client.ReadDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id),
new RequestOptions { PartitionKey = new PartitionKey(category) });
return (T)(dynamic)document;
}
catch (DocumentClientException e)
Expand Down Expand Up @@ -68,7 +69,8 @@ public static async Task<Document> UpdateItemAsync(string id, T item)

public static async Task DeleteItemAsync(string id, string category)
{
await client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id));
await client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id),
new RequestOptions { PartitionKey = new PartitionKey(category) });
}

public static void Initialize()
Expand Down