This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
environment: development | |
apphost: k8s | |
products: | |
label: | |
name: aspnet3core | |
container: | |
name: aspnet3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: aspnet3-demo | |
version: 1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"IsEncrypted": false, | |
"Values": { | |
"AzureWebJobsStorage": "UseDevelopmentStorage=true", | |
"FUNCTIONS_WORKER_RUNTIME": "dotnet", | |
"DatabaseName": "petshopapps", | |
"ContainerName": "orders", | |
"Account": "https://petshopapps.documents.azure.com:443/", | |
"CosmosKey": "sBlINeLXdn9PLk157Zu3PGMQ7hljAvZF02LOYrjLdqJO5GTHhro79WlxsGPXQT7GF4KptfJnsnqhjDaKZgRHXA==", | |
"ProductBaseUrl": "http://localhost:7071/api/UpdateProductQuantity" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.Cosmos; | |
using Microsoft.Azure.Cosmos.Fluent; | |
namespace PetShop.DBAccess.CosmosDB | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using PetShop.DBAccess.CosmosDB; | |
using PetShop.Model; | |
using PetShop.DBAccess.CosmosDB; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using Newtonsoft.Json; | |
using System.Text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Logging; | |
using Newtonsoft.Json; | |
using PetShop.Model; | |
using PetShop.Business.Orders; | |
namespace SaveOrders |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace PetShop.Model | |
{ | |
public class OrderedProduct | |
{ | |
public Guid ProductId; | |
public int OrderedProductQuantity { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace PetShop.DBAccess.CosmosDB | |
{ | |
public interface ICosmosDbService | |
{ | |
Task AddItemAsync<T>(T item, string id); | |
Task<T> GetItemAsync<T>(string id); | |
Task<IEnumerable<T>> GetItemsAsync<T>(string queryString); | |
Task UpdateItemAsync<T>(string id, T item); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ProductName":"Dog1", | |
"CustomerId":"17EDCACA-C902-431A-B935-A1FCF05CA52A", | |
"ProductId":"17EDCACb-C902-431A-B935-A1FCF05CA52A", | |
"OrderedProductQuantity":"20" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ProductName":"Dog1", | |
"CustomerId":"17EDCACA-C902-431A-B935-A1FCF05CA52A", | |
"ProductId":"new guid here", | |
"AvailableQuantity":"25" | |
} |