Skip to content
Docs Try Aspire
Docs Try

AspireExportAttribute Constructors

Class Constructors 3 members
Marks a method, type, or assembly-level type as an ATS (Aspire Type System) export.
Initializes a new instance for a capability export (on methods) with an explicit capability ID.
public sealed class AspireExportAttribute
{
public AspireExportAttribute(
string id)
{
// ...
}
}
id string The capability name for this method. The full capability ID is computed as {AssemblyName}/{id}. Use this overload only when disambiguation is needed (e.g., multiple overloads of the same method). When not specified, the capability ID is automatically derived from the method name using camelCase.
Initializes a new instance for a type or method export.
public sealed class AspireExportAttribute
{
public AspireExportAttribute()
{
// ...
}
}
For type exports, the type ID is automatically derived as {AssemblyName}/{TypeName}. Set AspireExportAttribute.ExposeProperties to true for context types whose properties should be exposed as get/set capabilities. For method exports, the capability ID is automatically derived from the method name using camelCase.
Initializes a new instance for an assembly-level type export.
public sealed class AspireExportAttribute
{
public AspireExportAttribute(
Type type)
{
// ...
}
}
type Type The CLR type to export to ATS.
Use this constructor at assembly level for types you don't own. The type ID is derived as {type.Assembly.Name}/{type.Name}.
[assembly: AspireExport(typeof(IConfiguration))]
// Type ID: Microsoft.Extensions.Configuration.Abstractions/IConfiguration