public static async Task <IHttpActionResult> Update(CompletedTrade completedTrade)
        {
            try
            {
                await client.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, Collection2Id, completedTrade.Id), completedTrade);

                return(new OkResult(new HttpRequestMessage()));
            }
            catch (Exception)
            {
                return(new NotFoundResult(new HttpRequestMessage()));
            }
        }
        public static async Task <IHttpActionResult> Create(CompletedTrade completedTrade)
        {
            try
            {
                await client.ReadDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, Collection2Id, completedTrade.Id));

                return(new BadRequestResult(new HttpRequestMessage()));
            }
            catch (DocumentClientException e)
            {
                if (e.StatusCode == HttpStatusCode.NotFound)
                {
                    await client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(DatabaseId, Collection2Id), completedTrade);

                    return(new OkResult(new HttpRequestMessage()));
                }

                throw;
            }
        }