In Metalama, you can add aspects using fabrics. In aspects, implement the BuildAspect(IAspectBuilder<T>). In fabrics, implement AmendType(ITypeAmender), AmendProject(IProjectAmender) or AmendNamespace(INamespaceAmender). In both cases, call the Select<TMember>(Func<TDeclaration, TMember>) or SelectMany<TMember>(Func<TDeclaration, IEnumerable<TMember>>) method, then call AddAspect<TDeclaration>(IQuery<TDeclaration>, Type, Func<TDeclaration, IAspect>).
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[Obsolete("In Metalama, you can add aspects using fabrics. In aspects, implement the 'IAspect<T>.BuildAspect(IAspectBuilder<T>)'. In fabrics, implement 'TypeFabric.AmendType(ITypeAmender)', 'ProjectFabric.AmendProject(IProjectAmender)' or 'NamespaceFabric.AmendNamespace(INamespaceAmender)'. In both cases, call the 'IQuery<TDeclaration>.Select<TMember>(Func<TDeclaration, TMember>)' or 'IQuery<TDeclaration>.SelectMany<TMember>(Func<TDeclaration, IEnumerable<TMember>>)' method, then call 'AspectQueryExtensions.AddAspect<TDeclaration>(IQuery<TDeclaration>, Type, Func<TDeclaration, IAspect>)'.", false)]
public interface IAspectProvider : IAspect, IServiceMethods
| Name | Description |
|---|---|
| ProvideAspects(object) |