AtsConstants
Class static net8.0
Constants for ATS (Aspire Type System) type IDs and capability IDs.
namespace Aspire.TypeSystem;
public static class AtsConstants{ // ...} 36 members
Methods14
Section titled MethodsArrayTypeId(string)staticstring Creates an array type ID for the given element type.
DictTypeId(string, string)staticstring Creates a Dict type ID for the given key and value types.
EnumTypeId(string)staticstring Creates an enum type ID for the given enum type full name.
GetCategory(string?, bool)static Gets the type category for a type ID. Note: This method cannot distinguish DTOs from Handles based on type ID alone. Use the scanner's type mapping to determine if a handle type is actually a DTO.
GetCategory(Type)static Gets the type category for a CLR type.
IsArray(string?)staticbool Checks if a type ID represents an array type.
IsDict(string?)staticbool Checks if a type ID represents a Dict type.
IsEnum(string?)staticbool Checks if a type ID represents an enum type.
IsHandle(string?)staticbool Checks if a type ID represents a handle type (has Assembly/Type format).
IsList(string?)staticbool Checks if a type ID represents a List type.
IsPrimitive(string?)staticbool Checks if a type ID represents a primitive type.
IsPrimitiveType(Type)staticbool Checks if a CLR type is a primitive ATS type.
IsReadOnlyDictType(Type)staticbool Checks if a dictionary type is readonly.
ListTypeId(string)staticstring Creates a List type ID for the given element type.
Fields22
Section titled FieldsAnystaticstring Any type ID. Maps from .NET
Object. Accepts any supported ATS type. Use when a parameter needs to accept multiple types without explicit union declaration. ApplicationTypeIdstaticstring Type ID for DistributedApplication.
AspireHostingAssemblystaticstring The Aspire.Hosting assembly name.
Booleanstaticstring Boolean type ID. Maps from .NET
Boolean. BuildCapabilitystaticstring Capability ID for building the application.
BuilderTypeIdstaticstring Type ID for IDistributedApplicationBuilder.
CancellationTokenstaticstring CancellationToken type ID. Maps from .NET
Threading.CancellationToken. In TypeScript, maps to AbortSignal for cancellation support. Charstaticstring Char type ID. Maps from .NET
Char. Serializes to JSON string. CreateBuilderCapabilitystaticstring Capability ID for creating a builder.
DateOnlystaticstring DateOnly type ID. Maps from .NET
DateOnly. Serializes to JSON string (YYYY-MM-DD). DateTimestaticstring DateTime type ID. Maps from .NET
DateTime. Serializes to JSON string (ISO 8601). DateTimeOffsetstaticstring DateTimeOffset type ID. Maps from .NET
DateTimeOffset. Serializes to JSON string (ISO 8601). EnumPrefixstaticstring Enum type ID prefix. Maps from .NET enum types. Full format: "enum:{FullTypeName}". Serializes to JSON string (enum name).
Guidstaticstring Guid type ID. Maps from .NET
Guid. Serializes to JSON string. Numberstaticstring Number type ID. Maps from .NET numeric types (int, long, float, double, decimal, etc.). Serializes to JSON number.
ReferenceExpressionTypeIdstaticstring Type ID for ReferenceExpression.
RunCapabilitystaticstring Capability ID for running the application.
Stringstaticstring String type ID. Maps from .NET
String. TimeOnlystaticstring TimeOnly type ID. Maps from .NET
TimeOnly. Serializes to JSON string (HH:mm:ss). TimeSpanstaticstring TimeSpan type ID. Maps from .NET
TimeSpan. Serializes to JSON number (total milliseconds). Uristaticstring Uri type ID. Maps from .NET
Uri. Serializes to JSON string. Voidstaticstring Void type ID. Represents no return value.