Class EndpointDiscoveryOptions
defines how endpoint discovery and registration should be done at startup
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public sealed class EndpointDiscoveryOptions
Properties
Assemblies
an optional collection of assemblies to discover endpoints from in addition to the auto discovered ones. if DisableAutoDiscovery is set to true, this must be provided.
NOTE: not applicable when using FastEndpoints.Generator package
Declaration
public IEnumerable<Assembly>? Assemblies { set; }
Property Value
Type | Description |
---|---|
IEnumerable<Assembly> |
AssemblyFilter
an optional predicate to filter out the final collection of assemblies before scanning for endpoints.
NOTE: not applicable when using FastEndpoints.Generator package
Declaration
public Func<Assembly, bool>? AssemblyFilter { set; }
Property Value
Type | Description |
---|---|
Func<Assembly, bool> |
DisableAutoDiscovery
set to true if only the provided Assemblies should be scanned for endpoints. if Assemblies is null and this is set to true, an exception will be thrown.
NOTE: not applicable when using FastEndpoints.Generator package
Declaration
public bool DisableAutoDiscovery { set; }
Property Value
Type | Description |
---|---|
bool |
Filter
a function to filter out types from auto discovery. the function you set here will be executed for each discovered type during startup. return 'false' from the function if you want to exclude a type from discovery. return 'true' to include. alternatively you can annotate the type/class with the DontRegisterAttribute to skip auto registration for that type.
Declaration
public Func<Type, bool>? Filter { set; }
Property Value
Type | Description |
---|---|
Func<Type, bool> |
IncludeAbstractValidators
by default only validators inheriting Validator<TRequest> are auto registered. if you'd like to also include validators inheriting FluentValidation.AbstractValidator<T>, set this to true.
Declaration
public bool IncludeAbstractValidators { set; }
Property Value
Type | Description |
---|---|
bool |
SourceGeneratorDiscoveredTypes
when using the FastEndpoints.Generator package, do .AddRange(<AssemblyName>.DiscoveredTypes.All
) on this property,
per referenced assembly if your solution has multiple projects, or simply assign to this property if there's only one project/assembly.
doing so will use the types discovered during source generation instead of reflection based type discovery.
Declaration
public List<Type> SourceGeneratorDiscoveredTypes { get; set; }
Property Value
Type | Description |
---|---|
List<Type> |