Пример #1
0
 private void AddSupportCode(HttpResponseMessage message)
 {
     try
     {
         try
         {
             if (!message.Headers.Contains(VersionHeaderName))
             {
                 message.Headers.Add(VersionHeaderName, versionHandler != null ? versionHandler.GetVersionNumber() : "");
             }
         }
         catch
         {
             // ignored
         }
         if (message.Headers.Contains(SupportCodeHeaderName))
         {
             return;
         }
         string supportCode;
         if (ApiTeardownActionFilter.TryGetSupportCode(Runtime, out supportCode))
         {
             message.Headers.Add(SupportCodeHeaderName, supportCode);
         }
         else
         {
             message.Headers.Add(SupportCodeHeaderName, Runtime.InstanceId.ToString());
         }
     }
     catch (Exception ex)
     {
         ex.Log();
     }
 }
Пример #2
0
 private void AddSupportCode()
 {
     try
     {
         try
         {
             HttpContext.Response.Headers.Add(VersionHeaderName, versionHandler != null ? versionHandler.GetVersionNumber() : "");
         }
         catch
         {
             // ignored
         }
         string supportCode;
         if (ApiTeardownActionFilter.TryGetSupportCode(Runtime, out supportCode))
         {
             HttpContext.Response.Headers.Add(BaseApiController.SupportCodeHeaderName, supportCode);
         }
         else
         {
             HttpContext.Response.Headers.Add(BaseApiController.SupportCodeHeaderName, Runtime.InstanceId.ToString());
         }
     }
     catch (Exception ex)
     {
         ex.Log();
     }
 }