Skip to content

Instantly share code, notes, and snippets.

View karthikeyanVK's full-sized avatar
🎯
Focusing

Karthikeyan VK karthikeyanVK

🎯
Focusing
View GitHub Profile
environment: development
apphost: k8s
products:
label:
name: aspnet3core
container:
name: aspnet3
name: aspnet3-demo
version: 1.0.0
{
"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"
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
{
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;
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
using System;
namespace PetShop.Model
{
public class OrderedProduct
{
public Guid ProductId;
public int OrderedProductQuantity { get; set; }
}
}
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);
{
"ProductName":"Dog1",
"CustomerId":"17EDCACA-C902-431A-B935-A1FCF05CA52A",
"ProductId":"17EDCACb-C902-431A-B935-A1FCF05CA52A",
"OrderedProductQuantity":"20"
}
{
"ProductName":"Dog1",
"CustomerId":"17EDCACA-C902-431A-B935-A1FCF05CA52A",
"ProductId":"new guid here",
"AvailableQuantity":"25"
}