RequiredScopeExtensions.RequireScope<TBuilder> Method

Definition

This method adds metadata to route endpoint to describe required scopes. It's the imperative version of the [RequiredScope] attribute.

public static TBuilder RequireScope<TBuilder> (this TBuilder endpointConventionBuilder, params string[] scope) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireScope : 'Builder * string[] -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireScope(Of TBuilder As IEndpointConventionBuilder) (endpointConventionBuilder As TBuilder, ParamArray scope As String()) As TBuilder

Type Parameters

TBuilder

Class implementing IEndpointConventionBuilder.

Parameters

endpointConventionBuilder
TBuilder

To customize the endpoints.

scope
String[]

Scope.

Returns

TBuilder

Builder.

Applies to