ControllerDescriptor.IsDefined Method (Type, Boolean)

 

Retrieves a value that indicates whether one or more instance of the specified custom attribute are defined for this member.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

public virtual bool IsDefined(
    Type attributeType,
    bool inherit
)
public:
virtual bool IsDefined(
    Type^ attributeType,
    bool inherit
)
abstract IsDefined : 
        attributeType:Type *
        inherit:bool -> bool
override IsDefined : 
        attributeType:Type *
        inherit:bool -> bool
Public Overridable Function IsDefined (
    attributeType As Type,
    inherit As Boolean
) As Boolean

Parameters

  • attributeType
    Type: System.Type

    The type of the custom attribute.

  • inherit
    Type: System.Boolean

    true to look up the hierarchy chain for the inherited custom attribute; otherwise, false.

Return Value

Type: System.Boolean

true if the attributeType is defined for this member; otherwise, false.

Implements

ICustomAttributeProvider.IsDefined(Type, Boolean)

Exceptions

Exception

Condition

ArgumentNullException

The attributeType parameter is null (Nothing in Visual Basic).

See Also

ControllerDescriptor Class
System.Web.Mvc Namespace

Return to top