Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggest for nested work #327

Closed
xlogex opened this issue Sep 10, 2023 · 1 comment
Closed

suggest for nested work #327

xlogex opened this issue Sep 10, 2023 · 1 comment

Comments

@xlogex
Copy link

xlogex commented Sep 10, 2023

t.IsPublic

&& (t.IsNestedPublic || t.IsPublic)

@yegorandrosov
Copy link

Found workaround

var catalog = new DependencyContextAssemblyCatalog();
var types = catalog.GetAssemblies().SelectMany(x => x.GetTypes());
var modules = types
            .Where(t =>
                !t.IsAbstract &&
                typeof(ICarterModule).IsAssignableFrom(t)
                && (t.IsPublic || t.IsNestedPublic)
            ).ToList();

builder.Services.AddCarter(configurator: c =>
{
    c.WithModules(modules.ToArray());
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants