Open sandboxFocus

Interface IAmender<T>

Base interface for the parameter passed to fabric methods such as AmendProject(IProjectAmender), AmendNamespace(INamespaceAmender), or AmendType(ITypeAmender). Provides capabilities to query declarations, add aspects programmatically, configure options, report diagnostics, and validate architecture.

Namespace: Metalama.Framework.Fabrics
Assembly: Metalama.Framework.dll
Syntax
public interface IAmender<out T> : IAmender, IQuery<T>, IQuery where T : class, IDeclaration
Type Parameters
Name Description
T

The type of declaration that this amender operates on (e.g., ICompilation for projects, INamespace for namespaces, INamedType for types).

Remarks

The amender interface provides access to LINQ-like querying capabilities through IQuery<TDeclaration>, allowing you to select declarations and apply aspects or configuration to them. It combines querying, aspect application, option configuration, and diagnostic reporting in a single interface.

Extension methods for this interface are provided by:

  • AspectQueryExtensions - for adding aspects to selected declarations
  • OptionQueryExtensions - for configuring options on selected declarations
  • DiagnosticsQueryExtensions - for reporting diagnostics and suppressions
  • QueryExtensions - for additional querying capabilities
  • Metalama.Extensions.Architecture.Predicates.PredicateExtensions - for architecture validation predicates
  • Metalama.Extensions.Validation.ValidationQueryExtensions - for validation rules
  • Metalama.Extensions.Validation.ReferenceValidationQueryExtensions - for reference validation
  • Metalama.Extensions.CodeFixes.CodeFixQueryExtensions - for code fix suggestions

Properties

Name Description
Outbound

Gets an object that allows to add child advice and to validate code and code references.

Project

Extension Methods

See Also