This PR adds the ability to create commands that are instantiated by the DI container. What this does in practice is allow your constructors to inject other services into them. It also allows you to control the lifetime of the command, ie Singleton or Scoped.
This also adds a helper extension method that allows you to register all your commands in an assembly very easily:
services.RegisterCommands(ServiceLifetime.Singleton); // Registers your commands in the calling assembly
services.RegisterCommands(ServiceLifetime.Scoped, Assembly1, Assembly2); // Registers your commands in the specified assemblies
This PR adds the ability to create commands that are instantiated by the DI container. What this does in practice is allow your constructors to inject other services into them. It also allows you to control the lifetime of the command, ie
Singleton
orScoped
.This also adds a helper extension method that allows you to register all your commands in an assembly very easily: