Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 /// <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;
     }
 }