Skip to content

Commit

Permalink
Merge pull request #1 from bigredmachine/master
Browse files Browse the repository at this point in the history
Fix partition key error
  • Loading branch information
mikepfeiffer authored Feb 3, 2018
2 parents 230c75f + 9704920 commit 0e7a597
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 0e7a597

Please sign in to comment.