Skip to content
Docs Try Aspire

ResourceNameAttribute

Class sealed net10.0
📦 Aspire.Hosting v13.1.2
Signifies that a parameter represents a resource name.

Decorate String parameters representing resource names with this attribute, e.g.:

public static IResourceBuilder<MyResource> AddCustomResource(
this IDistributedApplicationBuilder builder,
[ResourceName] string name)

namespace Aspire.Hosting.ApplicationModel;
public sealed class ResourceNameAttribute
: System.Attribute,
Aspire.Hosting.ApplicationModel.IModelNameParameter
{
// ...
}
This API supports analyzers in Aspire.Hosting.Analyzers.