Walter.Web.FireWall
BlockDurationAttribute Class
Members  Example 
Walter.Web.FireWall Assembly > Walter.Web.FireWall.Annotations Namespace : BlockDurationAttribute Class
This attribute allows you to configure a specific rule on a controller or a specific action end enables you to specify how long something should be blocked. Implements the System.Attribute
Syntax
public sealed class BlockDurationAttribute : System.Attribute 
Example
using Microsoft.AspNetCore.Mvc;
            namespace MyProject.Controllers
            {
            using Walter.Web.FireWall;
            using Walter.Web.FireWall.Annotations;
            using Walter.BOM.Geo;
            [Geo(blockLocation: GeoLocation.AFRICA | GeoLocation.LATIN_AMERICA | GeoLocation.Netherlands)]
            [User(allow: UserTypes.IsHuman | UserTypes.IsSearchEngine)]
            [BlockDuration(duration: 60, sliding: true, doubleDurationPerIncident: true)]
            public sealed class HomeController : Controller
            {
            private readonly ILogger<HomeController> _logger;
            public HomeController(ILogger<HomeController> logger)
            {
            _logger = logger;
            }
            public IActionResult Index()
            {
            return View();
            }
            public IActionResult Privacy()
            {
            return View();
            }
            [Ignore]
            [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
            public IActionResult Error()
            {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
            }
            }
            }
Inheritance Hierarchy

System.Object
   System.Attribute
      Walter.Web.FireWall.Annotations.BlockDurationAttribute

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

BlockDurationAttribute Members
Walter.Web.FireWall.Annotations Namespace
System.Attribute
View the IPageRequest.ViolationsStack to access all violations on the page including those raised by this filter
IFireWall.OnGuardAction: Will be raised if the firewall considers blocking and allows you to override the blocking action
IFireWall.OnIncident: Will be raised if the firewall considers generating an incident and allows you to override the incident registration