Represents a tuple type, such as (int, string) or (decimal Quantity, string ProductCode).
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
public interface ITupleType : INamedType, IType, IEquatable<IType>, IGeneric, IMemberOrNamedType, INamespaceOrNamedType, INamedDeclaration, IDeclaration, IDisplayable, IDiagnosticLocation, ICompilationElement, IMeasurable, IEquatable<IDeclaration>, IEquatable<INamedType>Remarks
ITupleType is derived from INamedType because C# tuple types are syntactic sugar over the ValueTuple type.
To create a tuple type, use CreateTupleType(params IEnumerable<IType>) or its overloads. To create an instance in generated code, use CreateCreateInstanceExpression(params IEnumerable<IExpression>).
Properties
| Name | Description |
|---|---|
| TupleElements | Gets the elements of the tuple. |
| TupleLength | Gets the number of elements in the tuple. |
Methods
| Name | Description |
|---|---|
| CreateCreateInstanceExpression(params IEnumerable<IExpression>) | Creates an IExpression that creates an instance of the tuple with the specified values, given as IExpression. |
| CreateCreateInstanceExpression(params dynamic?[]) | Creates an IExpression that creates an instance of the tuple with the specified values. |