ResourceTraitBuilderExtensions Methods
ClassMethods3 members
Provides methods for adding resource metadata and dashboard defaults.
WithDisplayOrder(IResourceBuilder<T>, int) Section titled WithDisplayOrder(IResourceBuilder<T>, int)extensionI 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) { // ... }}Parameters
builderIorderint 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. Returns
IResourceBuilder<T> The resource builder.WithTags(IResourceBuilder<T>, ReadOnlySpan<string>) Section titled WithTags(IResourceBuilder<T>, ReadOnlySpan<string>)extensionIAdds 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) { // ... }}Parameters
builderItagsReadOnlySpan<string> The tags, each up to 50 characters with single spaces between words.Returns
IResourceBuilder<T> The resource builder.WithTrait(IResourceBuilder<T>, string, string) Section titled WithTrait(IResourceBuilder<T>, string, string)extensionIAdds 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) { // ... }}Parameters
builderInamestringThe case-sensitive trait name.valuestringThe trait value. Do not include secrets.Returns
IResourceBuilder<T> The resource builder.