private void InitialiseTooltip(HelpInstructionModel data)
 {
     data.label           = _label;
     data.suppressScripts = _suppressScripts;
     data.suppressStyles  = _suppressStyles;
     data.loadOnDemand    = _loadondemand;
     data.apiUrl          = _apirooturl;
     data.imageurl        = $"{Request.Scheme}://{Request.Host}/images/help.png";
 }
        private HelpInstructionModel GetTooltipForKeyAsyncOnDemand()
        {
            HelpInstructionModel data;

            data = new HelpInstructionModel()
            {
                lookupKey = _datakey, tooltipText = $"Awaiting data response from server for key '{_hostkey}:{_datakey}'"
            };
            InitialiseTooltip(data);
            return(data);
        }
 private async Task <HelpInstructionModel> GetTooltipForKeyAsync()
 {
     using (var response = await _client.GetAsync($"{_apirooturl}/api/helpinstruction/Lookup/{_datakey}"))
     {
         HelpInstructionModel data;
         if (response.IsSuccessStatusCode)
         {
             data = await response.Content.ReadAsJsonAsync <HelpInstructionModel>();
         }
         else
         {
             data = new HelpInstructionModel()
             {
                 lookupKey = _datakey, tooltipText = $"No data exists for key '{_hostkey}:{_datakey}'"
             }
         };
         InitialiseTooltip(data);
         return(data);
     };
 }