本文整理汇总了C#中GlobalFilterCollection.Add方法的典型用法代码示例。如果您正苦于以下问题:C# GlobalFilterCollection.Add方法的具体用法?C# GlobalFilterCollection.Add怎么用?C# GlobalFilterCollection.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobalFilterCollection
的用法示例。
在下文中一共展示了GlobalFilterCollection.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new ExceptionFilter());
filters.Add(new ValidateInputAttribute(false));
filters.Add(new LoginFitler());
}
示例2: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
#if !DEBUG
filters.Add(new RequireHttpsAttribute());
#endif
}
示例3: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute{Order=1});
filters.Add(new HandleErrorAttribute{Order=2,ExceptionType=typeof(InvalidTokenException), View="Refresh"});
filters.Add(new TokenExtractingFilter());
filters.Add(new TokenPersistenceFilter());
}
示例4: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new InitializeSimpleMembershipAttribute());
filters.Add(new AllowCrossSiteJsonAttribute());
filters.Add(new ExceptionFilterAttribute());
}
示例5: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new AuthorizeAttribute());
//filters.Add(new CheckSessionOutAttribute());
//filters.Add(new EmplSessionExpireFilterAttribute());
}
示例6: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
// Lynicon install inserted these 2 lines
filters.Add(new ProcessIncludesAttribute());
filters.Add(new ProcessHtmlAttribute());
filters.Add(new HandleErrorAttribute());
}
示例7: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
#if !DEBUG
filters.Add(new System.Web.Mvc.AuthorizeAttribute());
#endif
}
示例8: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new SettingsAuthorizeAttribute());
filters.Add(new ExportModelStateToTempData());
filters.Add(new RequestTimingFilter());
}
示例9: RegisterGlobalFilters
/// <summary>
/// Registers the global filters.
/// </summary>
/// <param name="filters">The filters.</param>
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
//required for FluentSecurity
filters.Add(new HandleSecurityAttribute(), 0);
}
示例10: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new NoCacheFilterAttribute());
filters.Add(new SingleLoginFilterAttribute());
filters.Add(new FixModelFilterAttribute());
filters.Add(new HandleErrorAttribute());
}
示例11: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
// for all requests
filters.Add(new RequireHttpsAttribute());
}
示例12: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
var slackReport =
new WebHookErrorReportFilter(
new WebHookOptions(ConfigurationManager.AppSettings["slack:webhookurl"])
{
ChannelName = ConfigurationManager.AppSettings["slack:channel"],
//UserName = ConfigurationManager.AppSettings["slack:username"],
//IconEmoji = ConfigurationManager.AppSettings["slack:iconEmoji"],
//AttachmentColor = ConfigurationManager.AppSettings["slack:color"],
//AttachmentTitle = ConfigurationManager.AppSettings["slack:title"],
//AttachmentTitleLink = ConfigurationManager.AppSettings["slack:link"],
//Text = ConfigurationManager.AppSettings["slack:text"],
//ExceptionTextFormat = ConfigurationManager.AppSettings["slack:exceptionTextFormat"],
}
)
{
IgnoreHandled = true,
IgnoreExceptionTypes = new[] { typeof(System.ApplicationException) },
};
filters.Add(slackReport, 1);
//var slackReportEvented = new WebHookErrorReportFilter();
//slackReportEvented.OnExceptionReporting += slackReportEvented_OnExceptionReporting;
//filters.Add(slackReportEvented);
}
示例13: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
// this filter injects Notifications into the IBaseModel
filters.Add(new AdminFilter());
}
示例14: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new AuthorizeAttribute());
//filters.Add(new RequireHttpsAttribute());
}
示例15: RegisterGlobalFilters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new AuthorizeAttribute());
filters.Add(new HandleErrorAttribute());
filters.Add(new NoCacheFilter());
filters.Add(new LoginValidate());
}