Open sandboxFocus

Class QueryExtensions

Provides extension methods for IQuery<TDeclaration> to enable additional querying capabilities, such as selecting types by reflection, finding declarations with attributes, and selecting referenced assemblies.

Inheritance
QueryExtensions
Namespace: Metalama.Framework.Fabrics
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class QueryExtensions
Remarks

These extension methods complement the core query methods defined in IQuery<TDeclaration>, providing convenience methods for common querying scenarios within fabrics.

Methods

Name Description
SelectDeclarationsWithAttribute(IQuery<ICompilation>, Type, Func<IAttribute, bool>?, bool)

Selects all custom attributes of a given type in the current compilation. This overloads accepts an optional predicate to filter the attribute.

SelectDeclarationsWithAttribute<TAttribute>(IQuery<ICompilation>, Func<TAttribute, bool>?, bool)

Selects all custom attributes of a given type in the current compilation. This generic overloads constructs the attribute and accepts an optional predicate to filter the attribute.

SelectReferencedAssembly(IQuery<ICompilation>, string)

Selects a reference assembly in the current compilation given its assembly name.

SelectReflectionType(IQuery<ICompilation>, Type)

Selects an INamedType in the current compilation or in a reference assembly given its reflection Type.

SelectReflectionTypes(IQuery<ICompilation>, IEnumerable<Type>)

Selects several INamedType in the current compilation or in a reference assembly given their reflection Type.

SelectReflectionTypes(IQuery<ICompilation>, params Type[])

Selects several INamedType in the current compilation or in a reference assembly given their reflection Type.

See Also