Skip to content

Commit

Permalink
throw if no assembiles provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Hona committed Dec 22, 2023
1 parent 5648f77 commit 4efa5ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ public static class EndpointDiscovery

public static void RegisterEndpoints(this IEndpointRouteBuilder endpoints, params Assembly[] assemblies)
{
if (assemblies.Length == 0)
{
throw new ArgumentException("At least one assembly must be provided.", nameof(assemblies));
}

var endpointTypes = GetEndpointTypes(assemblies);

foreach (var type in endpointTypes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ public static class ModuleDiscovery

public static void ConfigureModules(this IServiceCollection services, params Assembly[] assemblies)
{
if (assemblies.Length == 0)
{
throw new ArgumentException("At least one assembly must be provided.", nameof(assemblies));
}

var moduleTypes = GetModuleTypes(assemblies);

foreach (var type in moduleTypes)
Expand Down

0 comments on commit 4efa5ef

Please sign in to comment.