using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;

namespace WebApplication1.ActionFilers {
  public class EstCeLActionDemandeeAttribute : ActionNameSelectorAttribute {
    public override bool IsValidName( ControllerContext controllerContext, string actionName, MethodInfo methodInfo ) {
      if( actionName.Equals( methodInfo.Name, StringComparison.InvariantCultureIgnoreCase ) ) // Simple : action == méthode
        return true;
      var request = controllerContext.RequestContext.HttpContext.Request;
      return request[methodInfo.Name] != null;
    }
  }
}