ResourceTraitBuilderExtensions Methods

ClassMethods3 members
Provides methods for adding resource metadata and dashboard defaults.
WithDisplayOrder(IResourceBuilder<T>, int)Section titled WithDisplayOrder(IResourceBuilder<T>, int)extensionIResourceBuilder<T>
Sets the default display order of the resource in lists of resources, such as the dashboard's. A saved ordering takes precedence. Repeated calls replace the order.
public static class ResourceTraitBuilderExtensions
{
public static IResourceBuilder<T> WithDisplayOrder<T>(
this IResourceBuilder<T> builder,
int order)
{
// ...
}
}
builderIResourceBuilder<T>The resource builder.
orderint A relative sort key. Higher values appear first, consistent with ResourceUrlAnnotation.DisplayOrder. Resources without a display order are treated as having an order of 0, so a negative value moves a resource after them.
IResourceBuilder<T>The resource builder.
WithTags(IResourceBuilder<T>, ReadOnlySpan<string>)Section titled WithTags(IResourceBuilder<T>, ReadOnlySpan<string>)extensionIResourceBuilder<T>
Adds AppHost-defined dashboard tags that users cannot remove. Repeated calls add tags.
public static class ResourceTraitBuilderExtensions
{
public static IResourceBuilder<T> WithTags<T>(
this IResourceBuilder<T> builder,
params ReadOnlySpan<string> tags)
{
// ...
}
}
builderIResourceBuilder<T>The resource builder.
tagsReadOnlySpan<string>The tags, each up to 50 characters with single spaces between words.
IResourceBuilder<T>The resource builder.
WithTrait(IResourceBuilder<T>, string, string)Section titled WithTrait(IResourceBuilder<T>, string, string)extensionIResourceBuilder<T>
Adds immutable, non-sensitive metadata to a resource. Repeated names add multiple values.
public static class ResourceTraitBuilderExtensions
{
public static IResourceBuilder<T> WithTrait<T>(
this IResourceBuilder<T> builder,
string name,
string value)
{
// ...
}
}
builderIResourceBuilder<T>The resource builder.
namestringThe case-sensitive trait name.
valuestringThe trait value. Do not include secrets.
IResourceBuilder<T>The resource builder.