public async Task UpsertItemAsync()

in RobotOrchestrator/CosmosDbClient.cs [88:107]


        public async Task<T> UpsertItemAsync(T itemToWrite, PartitionKey partitionKey)
        {
            // make sure that collection is created first
            if (documentCollection == null)
            {
                await EnsureDatabaseAndCollectionCreatedAsync();
            }

            try
            {
                await CreateItemIfNotExistsAsync(itemToWrite, partitionKey);
            }
            catch (DocumentClientException ex)
            {
                logger.LogError(ex.Message);
                throw;
            }

            return itemToWrite;
        }