0

Is it possible to have a ActionFilterAttribute parameters like this ?

[DataType(DataType.Password)]

For example I need to create something like this

[ValidateSession(Session.Required)]

public class ValidateSession : ActionFilterAttribute
{
    enum Session
    {
        Required,
        NotRequired
    }

    private Session _session { get; set; }

    public ValidateSession(Session session)
    {
        this._session = session;
    }
}
Ali Soltani
  • 9,589
  • 5
  • 30
  • 55
Iris
  • 1,436
  • 3
  • 14
  • 29

1 Answers1

1

You can add parameters to custom ActionFilter. For more information see this.

Community
  • 1
  • 1
Ali Soltani
  • 9,589
  • 5
  • 30
  • 55