/// <summary>
 /// Gets a setting.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.WebSitesExtensions.ISettingsOperations.
 /// </param>
 /// <param name='settingId'>
 /// The setting identifier.
 /// </param>
 /// <returns>
 /// The get setting operation response.
 /// </returns>
 public static SettingsGetResponse Get(this ISettingsOperations operations, string settingId)
 {
     try
     {
         return(operations.GetAsync(settingId).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Settings of different configurations in security center
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='settingName'>
 /// The name of the setting. Possible values include: 'MCAS', 'WDATP',
 /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel'
 /// </param>
 public static Setting Get(this ISettingsOperations operations, string settingName)
 {
     return(operations.GetAsync(settingName).GetAwaiter().GetResult());
 }
Esempio n. 3
0
 /// <summary>
 /// Gets a setting.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.WebSitesExtensions.ISettingsOperations.
 /// </param>
 /// <param name='settingId'>
 /// Required. The setting identifier.
 /// </param>
 /// <returns>
 /// The get setting operation response.
 /// </returns>
 public static Task <SettingsGetResponse> GetAsync(this ISettingsOperations operations, string settingId)
 {
     return(operations.GetAsync(settingId, CancellationToken.None));
 }