Пример #1
0
 internal virtual void SetStatusResult(HttpStatusCode status, params HttpStatusCode[] successfulStatuses)
 {
     if (typeof(T).IsEnum && typeof(T).Equals(status.GetType()))
     {
         if (successfulStatuses == null || !successfulStatuses.Any() || successfulStatuses.Contains(status))
         {
             SetResult(status);
         }
         else
         {
             throw new SelectelWebException(status);
         }
     }
     else
     {
         throw new ArgumentException();
     }
 }