AspireExportAttribute Constructors
Class Constructors 3 members
Marks a method, type, or assembly-level type as an ATS (Aspire Type System) export.
Constructor(string) Section titled Constructor(string) Initializes a new instance for a capability export (on methods).
public sealed class AspireExportAttribute{ public AspireExportAttribute( string id) { // ... }}Parameters
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. Constructor Section titled Constructor Initializes a new instance for a type export.
public sealed class AspireExportAttribute{ public AspireExportAttribute() { // ... }}Remarks
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. Constructor(Type) Section titled Constructor(Type) Initializes a new instance for an assembly-level type export.
public sealed class AspireExportAttribute{ public AspireExportAttribute( Type type) { // ... }}Parameters
type Type The CLR type to export to ATS. Remarks
Use this constructor at assembly level for types you don't own. The type ID is derived as
{type.Assembly.Name}/{type.Name}. Examples
[assembly: AspireExport(typeof(IConfiguration))]// Type ID: Microsoft.Extensions.Configuration.Abstractions/IConfiguration