More clarity needed for the InternalCommandsModule

Author: GianlucaLocriCreated Aug 7, 2024Updated Aug 7, 2024

Hi, first of all THANKS for the invaluable work you shared with us. I'm studying your code but I cannot get around an apparently simple thing...

Talking about User Registration process.

  1. The New User Registered Integration Event is sent to the bus, then Meeting, Administration and Payment modules are subscribed to this event. Let's ignore the Payment module for now on.
  2. The Integration event is handled with the NewUserRegisteredIntegrationEventHandler for each module. The handler function simply enqueues a CreateMemberCommand that is an internal command using the command scheduler.
  3. The command handler is somewhat called and both modules perform the adding action to the database.

Now the question is: what are supposed to do line 71 and 73 in the AdministraionStartup.cs ? 71: internalCommandsMap.Add("CreateMember", typeof(CreateMemberCommand)); 73: containerBuilder.RegisterModule(new InternalCommandsModule(internalCommandsMap));

I really cannot understand the purpose of the InternalCommandsModule (used only in the Administration module). What I am missing here?

Source: kgrzybek/modular-monolith-with-ddd