MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeIConstructor
Open sandboxFocus

IConstructor Interface

Represents an instance constructor or a static constructor.

Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
public interface IConstructor : IMethodBase, IHasParameters, IMember, IMemberOrNamedType, INamedDeclaration, IDeclaration, IDisplayable, IDiagnosticLocation, ICompilationElement, IMeasurable

Properties

Name Description
Definition

Gets the definition of the constructor. If the current declaration is a constructor of a generic type instance, this returns the constructor in the generic type definition. Otherwise, it returns the current instance.

InitializerKind

Gets a ConstructorInitializerKind that specifies the initializer semantics of the constructor.

IsPrimary

Gets a value indicating whether this constructor is the primary constructor of the type.

Methods

Name Description
ToConstructorInfo()

Gets a System.Reflection.ConstructorInfo that represents the current constructor at run time.

Extension Methods

DeclarationExtensions.IsRecordCopyConstructor(IConstructor)
GenericExtensions.GetOriginalDefinition(IConstructor)
GenericExtensions.ForTypeInstance(IConstructor, INamedType)