Ejemplo n.º 1
0
 /// <summary>
 ///   Throws <see cref="HttpException"/> if given condition is true.
 /// </summary>
 /// <param name="condition">The condition.</param>
 /// <param name="httpStatusCode">The HTTP status code corresponding to the error.</param>
 /// <param name="message">The required message.</param>
 /// <param name="additionalInfo">Additional exception info.</param>
 /// <exception cref="HttpException">If given condition is true.</exception>
 public void If(bool condition, HttpStatusCode httpStatusCode, string message, HttpExceptionInfo additionalInfo)
 {
     if (condition)
     {
         throw new HttpException(httpStatusCode, message, additionalInfo);
     }
 }
Ejemplo n.º 2
0
 public void IfNot(bool condition, HttpStatusCode httpStatusCode, string message, HttpExceptionInfo additionalInfo)
 {
     if (!condition)
     {
         throw new HttpException(httpStatusCode, message, additionalInfo);
     }
 }