Represents the structure of a record: the members that the compiler synthesizes for it.
Namespace: Metalama.Framework.Code.Types
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
[InternalImplement]
public interface IRecordFacet : ITypeFacetRemarks
The facet is reached through Record, as in
type.Facets.Record?.PrintMembersMethod. It is null for a type that
IsRecord reports as not being a record.
One interface describes a record class and a record struct. A record struct has no equality contract, no clone
method and no copy constructor, so these three properties are null for it.
The members that the compiler adds to a record and that are not specific to a record are not part of the facet:
Equals, GetHashCode, ToString, and the == and != operators are reached through
the member collections of INamedType like any other member. The primary constructor is reached
through PrimaryConstructor, because a primary constructor is not specific to a record
since C# 12.
Properties
| Name | Description |
|---|---|
| CloneMethod | Gets the clone method, whose metadata name is |
| CopyConstructor | Gets the copy constructor, which the clone method calls, or |
| DeconstructMethod | Gets the |
| EqualityContractProperty | Gets the |
| PositionalProperties | Gets the properties that the positional parameters of the record declare, in the order of the parameters, or an empty list when the record is not positional. A positional parameter that declares no property, because the record or one of its base records declares a member of that name itself, contributes no element. |
| PrintMembersMethod | Gets the |