public ExternalAPIDTO(ExternalAPIEntry entry)
 {
     Source           = entry.PartitionKey;
     Slug             = entry.RowKey;
     Title            = entry.Title;
     ShortDescription = entry.ShortDescription;
     URL = entry.URL;
     UID = entry.UID;
 }
 private void InsertOrMergeEntity(ExternalAPIEntry entity)
 {
     try
     {
         TableOperation insertOrMergeOperation = TableOperation.InsertOrMerge(entity);
         TableResult    result = cloudTable.Execute(insertOrMergeOperation);
     }
     catch (Exception ex)
     {
     }
 }
        public ExternalAPIDTO GetSpecificRow(string partitionKey, string rowKey)
        {
            ExternalAPIEntry entry = tableWorker.RetrieveSpecificEntry(partitionKey, rowKey);

            if (entry != null)
            {
                return(ConvertEntryToDTO(entry));
            }
            else
            {
                return(null);
            }
        }
        private ExternalAPIEntry RetrieveSpecificEntity(string partitionKey, string rowKey)
        {
            try
            {
                TableOperation   retrieveOperation = TableOperation.Retrieve <ExternalAPIEntry>(partitionKey, rowKey);
                TableResult      result            = this.cloudTable.Execute(retrieveOperation);
                ExternalAPIEntry apiRow            = result.Result as ExternalAPIEntry;

                return(apiRow);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
 public void WriteEntry(ExternalAPIEntry entity)
 {
     InsertOrMergeEntity(entity);
 }
        /// <summary>
        /// Method to return a specific entry in Table Storage.
        /// </summary>
        /// <param name="partitionKey">Partition Key of the entry.</param>
        /// /// <param name="rowKey">Row Key of the entry.</param>
        public ExternalAPIEntry RetrieveSpecificEntry(string partitionKey, string rowKey)
        {
            ExternalAPIEntry entry = RetrieveSpecificEntity(partitionKey, rowKey);

            return(entry);
        }
 private ExternalAPIDTO ConvertEntryToDTO(ExternalAPIEntry entry)
 {
     return(new ExternalAPIDTO(entry));
 }
 public void WriteEntry(ExternalAPIEntry entry)
 {
     tableWorker.WriteEntry(entry);
 }