Open sandboxFocus
  • TOC

Metalama Documentation

Getting started

Video tutorials

Conceptual documentation

Commented examples

API documentation

Aspect API

Metalama.​Framework.​Advising

Metalama.​Framework.​Aspects

Metalama.​Framework.​Code

Metalama.​Framework.​Code.​Collections

Metalama.​Framework.​Code.​Comparers

Metalama.​Framework.​Code.​Declaration­Builders

Metalama.​Framework.​Code.​Invokers

Metalama.​Framework.​Code.​Syntax­Builders

Metalama.​Framework.​Code.​Types

Metalama.​Framework.​Code­Fixes

Metalama.​Framework.​Diagnostics

Metalama.​Framework.​Eligibility

Metalama.​Framework.​Fabrics

Metalama.​Framework.​Metrics

Metalama.​Framework.​Options

Metalama.​Framework.​Project

Metalama.​Framework.​Run­Time

Metalama.​Framework.​Serialization

Metalama.​Framework.​Services

Metalama.​Framework.​Utilities

Metalama.​Framework.​Validation

Extensions API

Patterns API

Flashtrace API

Introspection API

Advanced API

Post­Sharp API migration

  • Article

Method RemoveAttributes

RemoveAttributes(IAdviser<IDeclaration>, INamedType)

Removes all custom attributes of a given INamedType from a given declaration. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

Declaration
public static IRemoveAttributesAdviceResult RemoveAttributes(this IAdviser<IDeclaration> adviser, INamedType attributeType)
Parameters
Type Name Description
IAdviser<IDeclaration> adviser

An adviser for a declaration.

INamedType attributeType

The type of custom attributes to be removed.

Returns
Type Description
IRemoveAttributesAdviceResult

RemoveAttributes(IAdviser<IDeclaration>, Type)

Removes all custom attributes of a given Type from a given declaration. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

Declaration
public static IRemoveAttributesAdviceResult RemoveAttributes(this IAdviser<IDeclaration> adviser, Type attributeType)
Parameters
Type Name Description
IAdviser<IDeclaration> adviser

An adviser for a declaration.

Type attributeType

The type of custom attributes to be removed.

Returns
Type Description
IRemoveAttributesAdviceResult