Walter.BOM Namespace
Walter.Web.FireWall Namespace
ASP-WAF | .Net API for WAF Systems

ItemCompairs Enumeration

Enum ItemCompairs tests how an item compares to it's dictionary value

Namespace:  Walter.Web.FireWall
Assembly:  Walter.Web.FireWall (in Walter.Web.FireWall.dll)

Syntax


public enum ItemCompairs

Members


Member nameDescription
None The not set
ItemNotExists The item not exists
ItemExists The item exists
ValueMatches The value matches
ValueIsNotMatch Value exists but the value does not match the projected value

Examples


The following example looks at the page header and tests if the header contains the user salt key
C#
public class HealthController : Controller
   {

       IPageRequest _page;
       IFireWall _fireWall;

       public HealthController(IPageRequest page)
       {
           _page = page;
           _fireWall = page.FireWall;

       }

       [HttpGet]
       [Produces("text/plain")]
       public string Index()
       {
           if (_page.TryHasHeader(_fireWall.Configuration.UseHeaderNames[HeaderName.UserEncryptionSalt], _page.User.GetUserSalt(), out var headerOk)
               &&  headerOk.HasFlag(ItemCompairs.ValueMatches))
           {
               return _fireWall.Report(ReportTypes.ALL);
           }
           return _fireWall.Report(ReportTypes.DEFAULT);
       }
   }

See Also


Walter.Web.FireWall..::..ItemCompairs