Skip to content

Instantly share code, notes, and snippets.

@zhitchcock
zhitchcock / FilterIPAttribute.cs
Created June 15, 2012 00:09 — forked from rdingwall/FilterIPAttribute.cs
FilterIPAttribute for ASP.NET Web API (IIS only, port of MVC version from http://stackoverflow.com/a/4605086/91551). Constructor added that provides defaults for Configuration keys. Allows attribute to be added as [IPAddress()]
using System;
using System.Configuration;
using System.Web;
using System.Web.Http;
using System.Web.Http.Controllers;
namespace Miscellaneous.Attributes.Controller
{
/// <summary>
/// Filter by IP address (ASP.NET Web API version)