Skip to content
Docs Try Aspire

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).
public sealed class AspireExportAttribute
{
public AspireExportAttribute(
string id)
{
// ...
}
}
id string The method name for this capability. The full capability ID is computed as {AssemblyName}/{methodName}. For example: "addRedis" in Aspire.Hosting.Redis becomes Aspire.Hosting.Redis/addRedis.
Initializes a new instance for a type export.
public sealed class AspireExportAttribute
{
public AspireExportAttribute()
{
// ...
}
}
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.
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