Class EndpointOptions
endpoint registration options
Inheritance
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public class EndpointOptions
Properties
Configurator
a configuration action to be performed on each endpoint definition during startup.
some of the same methods you use inside Configure()
method are available to be called on the EndpointDefinition
parameter.
this can be used to apply a set of common configuration settings globally to all endpoints.
i.e. apply globally applicable settings here and specify only the settings applicable to individual endpoints from within each endpoints' Configure()
method.
app.UseFastEndpoints(c => c.Configurator = ep =>
{
ep.AllowAnonymous();
ep.Description(b => b.Produces<ErrorResponse>(400));
});
Declaration
public Action<EndpointDefinition> Configurator { set; }
Property Value
Type | Description |
---|---|
System.Action<EndpointDefinition> |
Filter
a function to filter out endpoints from auto registration. the function you set here will be executed for each endpoint during startup. you can inspect the EndpointSettings to check what the current endpoint is, if needed. return 'false' from the function if you want to exclude an endpoint from registration. return 'true' to include. this function will executed for each endpoint that has been discovered during startup.
Declaration
public Func<EndpointDefinition, bool> Filter { set; }
Property Value
Type | Description |
---|---|
System.Func<EndpointDefinition, System.Boolean> |
RoutePrefix
prefix for all routes (example 'api').
Declaration
public string RoutePrefix { set; }
Property Value
Type | Description |
---|---|
System.String |
ShortNames
set to true if you'd like the endpoint names/ swagger operation ids to be just the endpoint class names instead of the full names including namespace.
Declaration
public bool ShortNames { set; }
Property Value
Type | Description |
---|---|
System.Boolean |