Skip to content

Instantly share code, notes, and snippets.

@dj-nitehawk
Last active January 23, 2024 04:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dj-nitehawk/b3615fad393beabefe929e3f81af6822 to your computer and use it in GitHub Desktop.
Save dj-nitehawk/b3615fad393beabefe929e3f81af6822 to your computer and use it in GitHub Desktop.
Registration of additional assemblies for type discovery
bld.Services.AddFastEndpoints(
o => o.Assemblies = new[]
{
typeof(SomeAssemblyName).Assembly,
typeof(AnotherAssemblyName).Assembly
});
//this also enables bypassing the default blacklist of assemblies: https://github.com/FastEndpoints/FastEndpoints/blob/main/Src/Library/Main/EndpointData.cs#L28-L48
@dj-nitehawk
Copy link
Author

dj-nitehawk commented Dec 22, 2023

// source generator version

bld.Services
   .AddFastEndpoints(
       o =>
       {
           o.SourceGeneratorDiscoveredTypes.AddRange(SomeAssemblyName.DiscoveredTypes.All);
           o.SourceGeneratorDiscoveredTypes.AddRange(AnotherAssemblyName.DiscoveredTypes.All);
       })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment