Carter icon indicating copy to clipboard operation
Carter copied to clipboard

suggest for nested work

Open xlogex opened this issue 2 years ago • 1 comments

t.IsPublic

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

xlogex avatar Sep 10 '23 04:09 xlogex

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());
});

yegorandrosov avatar Sep 26 '23 14:09 yegorandrosov