Skip to content

Instantly share code, notes, and snippets.

@dj-nitehawk
Last active November 26, 2024 07:34
Show Gist options
  • 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#L36-L56
@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