Example #1
0
        public async Task <bool> UpdateOrderAsync(Order orderToUpdate)
        {
            var cosmosOrder = new CosmosOrderDto
            {
                Id     = orderToUpdate.Id.ToString(),
                Amount = orderToUpdate.Amount
            };

            var response = await _cosmosStore.UpdateAsync(cosmosOrder);

            return(response.IsSuccess);
        }
Example #2
0
        public async Task <bool> CreateOrderAsync(Order order)
        {
            var cosmosOrder = new CosmosOrderDto
            {
                Id     = Guid.NewGuid().ToString(),
                Amount = order.Amount
            };

            var response = await _cosmosStore.AddAsync(cosmosOrder);

            order.Id = Guid.Parse(cosmosOrder.Id);
            return(response.IsSuccess);
        }