Skip to content

Commit

Permalink
Fix partition key error
Browse files Browse the repository at this point in the history
  • Loading branch information
bigredmachine committed Jan 28, 2018
1 parent 230c75f commit 9704920
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MovieMVC/Models/DocumentDBRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ private static async Task CreateCollectionIfNotExistsAsync()
{
if (e.StatusCode == System.Net.HttpStatusCode.NotFound)
{
var documentCollection = new DocumentCollection { Id = CollectionId };
documentCollection.PartitionKey.Paths.Add("/id");

await client.CreateDocumentCollectionAsync(
UriFactory.CreateDatabaseUri(DatabaseId),
new DocumentCollection { Id = CollectionId },
documentCollection,
new RequestOptions { OfferThroughput = 1000 });
}
else
Expand Down

0 comments on commit 9704920

Please sign in to comment.