You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: A modular monolith .net 8 app where each module has following class libraries:
Domain: Entities, Dbcontext, repositories, and any handlers(for commands, queries or events). Everyhting is marked as internal
Contracts: Commands, Queries, Events, Dtos
Application: Where the controllers themselves are defined.
In the Web Api project i am trying to register Wolverine Handlers. I currently only changed the login commandHandler to be an IWolverineHandler so I can play around with it.
I did read from the Wolverine documentation that by default it looks for public concrete classes, but I also found the .IsNotPublic specification, so I am a little confused.
Part of Program.cs code:
builder.Host.UseWolverine(opts =>{ opts.Discovery.DisableConventionalDiscovery().CustomizeHandlerDiscovery(c =>{ c.Includes.IsNotPublic();//Here I specify it to look for non public classes c.Includes.WithNameSuffix("Handler"); c.Includes.Implements<IWolverineHandler>();//Here I specify it to look for handlers that implement thisList<Assembly>assemblies=[ ..IdentityDomainServiceExtensionMethods.GetIdentityAssemblies()]; c.Find(assemblies);}).CustomizeMessageDiscovery(c =>{ c.Includes.WithNameSuffix("Command"); c.Includes.WithNameSuffix("Query"); c.Includes.WithNameSuffix("Event");}); opts.CodeGeneration.TypeLoadMode = TypeLoadMode.Auto; opts.UseFluentValidation(); opts.LocalQueue("in-process-queue"); opts.LogMessageStarting(LogLevel.Information);});
The definition of the method that returns the Assemblies of interest
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey, guys!
Context: A modular monolith .net 8 app where each module has following class libraries:
In the Web Api project i am trying to register Wolverine Handlers. I currently only changed the login commandHandler to be an IWolverineHandler so I can play around with it.
I did read from the Wolverine documentation that by default it looks for public concrete classes, but I also found the .IsNotPublic specification, so I am a little confused.
Part of Program.cs code:
The definition of the method that returns the Assemblies of interest
The Login command message:
The Login command handler:
Whatever I have tried it still throws an exception like:
So please help me with my confusion!
Is there something that I can do to register non public Handlers?
Beta Was this translation helpful? Give feedback.
All reactions