public bool?Validate(HttpRequest request) { IPAddress_v4 ip = IPAddress_v4.TryCreate(request.UserHostAddress); if (ip == null) { return(null); } if (this.IPAddresses.Contains(ip) == true) { return(false); } return(null); }
public Boolean?Validate(HttpRequest request) { var req = request; IPAddress_v4 ip = IPAddress_v4.TryCreate(req.UserHostAddress); if (ip == null) { return(null); } if (this.Start.Value <= ip.Value && ip.Value <= this.End.Value) { return(this.Allow); } return(!this.Allow); }