/// <summary> /// Returns the document with the given key. /// </summary> /// <param name="key">The document key.</param> /// <returns>The document.</returns> public ECADocument GetDocumentById(DocumentKey key) { var client = GetClient(); var doc = client.Documents.Get <ECADocument>(key.ToString()); return(doc.Document); }
/// <summary> /// Returns the document with the given key. /// </summary> /// <param name="key">The document key.</param> /// <returns>The document.</returns> public async Task <ECADocument> GetDocumentByIdAsync(DocumentKey key) { var client = GetClient(); var doc = await client.Documents.GetAsync <ECADocument>(key.ToString()); return(doc.Document); }
/// <summary> /// Sets the Id and DocumentTypeId of this document via the given document key. /// </summary> /// <param name="key">The document key.</param> public void SetKey(DocumentKey key) { if (key != null) { this.Id = key.ToString(); this.DocumentTypeId = key.DocumentTypeId.ToString(); } else { this.Id = null; this.DocumentTypeId = null; } }