Class EndpointDiscoveryOptions
defines how endpoint discovery and registration should be done at startup
Inheritance
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public class EndpointDiscoveryOptions
Properties
Assemblies
an optional collection of assemblies to discover endpoints from. 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 |
---|---|
System.Collections.Generic.IEnumerable<System.Reflection.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 |
---|---|
System.Func<System.Reflection.Assembly, System.Boolean> |
DisableAutoDiscovery
set to true if only the provided Assemblies should be scanned for endpoints. if the Assemblies property 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 |
---|---|
System.Boolean |
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.
Declaration
public Func<Type, bool> Filter { set; }
Property Value
Type | Description |
---|---|
System.Func<System.Type, System.Boolean> |
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 |
---|---|
System.Boolean |
SourceGeneratorDiscoveredTypes
if using the FastEndpoints.Generator package, assign DiscoveredTypes.All
to this property.
doing so will use the types discovered during source generation instead of reflection based type discovery.
Declaration
public Type[] SourceGeneratorDiscoveredTypes { set; }
Property Value
Type | Description |
---|---|
System.Type[] |