コード例 #1
0
 /// <summary>
 /// Get a resource value using a key
 /// </summary>
 /// <param name="languageId"> </param>
 /// <param name="key"></param>
 /// <returns></returns>
 public LocaleStringResource GetResource(Guid languageId, string key)
 {
     try
     {
         return(_localizationRepository.GetResource(languageId, key.Trim()));
     }
     catch (Exception ex)
     {
         // Could be there is no resource
         _loggingService.Error(string.Format("Unable to retrieve resource key '{0}' for language id {1}. Error: '{2}'.", key, languageId.ToString(), ex.Message));
         return(null);
     }
 }