本文整理匯總了C#中System.Web.HttpApplication.AssertNotNull方法的典型用法代碼示例。如果您正苦於以下問題:C# HttpApplication.AssertNotNull方法的具體用法?C# HttpApplication.AssertNotNull怎麽用?C# HttpApplication.AssertNotNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.HttpApplication
的用法示例。
在下文中一共展示了HttpApplication.AssertNotNull方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Init
/// <summary>
/// Initializes a module and prepares it to handle requests.
/// </summary>
/// <param name="context">
/// An <see cref="HttpApplication" /> that provides access to the methods,
/// properties, and events common to all application objects within an ASP.NET application
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="context"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// <paramref name="context"/> does not implement <see cref="IJwtValidationParametersProvider"/>.
/// </exception>
public void Init(HttpApplication context)
{
context.AssertNotNull("context");
var app = context as IJwtValidationParametersProvider;
if (app == null)
{
throw new InvalidOperationException(InvariantStrings.InvalidHttpApplication);
}
this.tokenValidationParameters = app.TokenValidationParameters;
context.AuthenticateRequest += this.Application_AuthenticateRequest;
}