public async Task CreateDocumentAsync(DeploymentRoot deploymentObject) { try { await _client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(_dbName, _collectionName), deploymentObject); } catch (DocumentClientException ex) { throw new ApplicationException("Error creating document.", ex); } }
public IActionResult Post([FromBody] DeploymentRoot bodyObj) { try { _dataAccessLayer.CreateDocumentAsync(bodyObj); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }