/// <summary>
        ///     This code pulls the metadata from a SQL Server table and stores it within a local cache.
        /// </summary>
        private static void PullCache()
        {
            var dbConnString  = RoleEnvironment.GetConfigurationSettingValue("MetadataDBConnectionString");

            lock (moCacheLock)
            {
                using (var dbConn = new SqlConnection(dbConnString))
                {
                    dbConn.Open();

                    var cmdRetrieveMD = new SqlCommand(CONST_RETRIEVE_METADATA_SQL, dbConn);

                    using (SqlDataReader reader = cmdRetrieveMD.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            MetadataItem oNewItem = new MetadataItem(reader);

                            moMetadataCache.Add(oNewItem);
                        }
                    }
                }
            }
        }
 /// <summary>
 ///     Under Construction
 /// </summary>
 private string SaveFile(MetadataItem item, List<Dictionary<string, string>> body) { return ""; }
 /// <summary>
 ///     Under Construction
 /// </summary>
 private string GetFileContents(MetadataItem item, string param1) { return "<value>TESTING789</value>"; }
 /// <summary>
 ///     Under Construction
 /// </summary>
 private string GetFileContents(MetadataItem item, List<Dictionary<string, string>> body) { return "<value>TESTING789</value>"; }
 /// <summary>
 ///     Under Construction
 /// </summary>
 private string GetFileList(MetadataItem item, List<Dictionary<string, string>> body) { return "<value>TESTING456</value>"; }
 /// <summary>
 ///     Under Construction
 /// </summary>
 private string GetFileList(MetadataItem item, string param1) { return "<value>TESTING456</value>"; }
 /// <summary>
 ///     Under Construction
 /// </summary>
 private string GetNavPayload(MetadataItem item, List<Dictionary<string, string>> body) { return "<value>TESTING123</value>"; }
        /// <summary>
        /// 
        ///     This function returns the XML content that will serve as the navigational payload 
        ///     for a mobile app screen.
        ///     
        /// </summary>
        /// <param name="item">The metadata needed in order to retrieve the XML content from the target file.</param>
        /// <param name="param1">An additional value in order to assist with fulfilling the request</param>
        /// <returns>The XML content that serves as the navigational payload</returns>
        private string GetNavPayload(MetadataItem item, string param1) 
        {
            var NavPayload     = "<value>TESTING123</value>";
            var PayloadBuilder = new StringBuilder();

            if (!String.IsNullOrEmpty(item.Payload))
            {
                var MDRoot          = RoleEnvironment.GetConfigurationSettingValue("MetadataRootFileSystem");
                var PayloadFilepath = MDRoot + "\\" + item.Payload;

                using (StreamReader reader = new StreamReader(PayloadFilepath))
                {
                    String line = "";

                    while ((line = reader.ReadLine()) != null)
                        PayloadBuilder.Append(line).Append("\n");
                }

                NavPayload = PayloadBuilder.ToString();
            }

            return NavPayload;
        }
        /// <summary>
        /// 
        ///     This function finds and then returns the relevant record from the metadata cache
        ///     
        /// </summary>
        /// <param name="psType">The HTTP type of the request</param>
        /// <param name="psAction">The API type of the request</param>
        /// <param name="psMainParam">The API subtype of the request</param>
        /// <returns>The relevant record of the cache</returns>
        private static MetadataItem GetCacheItem(string psType, string psAction, string psMainParam) 
        {
            MetadataItem oMDItem = new MetadataItem();

            try
            {
                if (moMetadataCache.Count == 0)
                    PullCache();

                lock (moCacheLock)
                {
                    foreach (MetadataItem TempItem in moMetadataCache)
                    {
                        if ((TempItem.Action == psAction) && !String.IsNullOrEmpty(psType) && (TempItem.Type == psType))
                        {
                            if ((TempItem.Type == "GET") && (TempItem.PvalName == psMainParam))
                            {
                                oMDItem = TempItem;
                                break;
                            }
                            else if ((TempItem.Type == "POST") && (TempItem.PvalCommand == psMainParam))
                            {
                                oMDItem = TempItem;
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex);
            }

            return oMDItem; 
        }