Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public async Task<Catalog> AddProduct(
  2. Catalog order)
  3. {
  4. var requestOptions =
  5. new RequestOptions
  6. {
  7. PartitionKey = new PartitionKey(order.Id.ToString())
  8. };
  9.  
  10. var catalogDocument = await _cosmosClient.CreateDocumentAsync(
  11. UriFactory.CreateDocumentCollectionUri(
  12. _azureCosmosDbOptions.Value.DatabaseId, "catalog"), order, requestOptions);
  13.  
  14. return
  15. (Catalog)((dynamic)catalogDocument.Resource);
  16. }
  17.  
  18. "id": "8000003c-0001-fb00-b63f-84710c7967aa",
  19.  
  20. "industy": {
  21.  
  22. "category": [
  23. {
  24.  
  25. "subcategory": [
  26. {
  27. product1,product2.....
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement