diff --git a/src/Nitride/NitrideBuilder.cs b/src/Nitride/NitrideBuilder.cs index d184ee3..d3845de 100644 --- a/src/Nitride/NitrideBuilder.cs +++ b/src/Nitride/NitrideBuilder.cs @@ -13,6 +13,8 @@ using Serilog; using Zio; using Zio.FileSystems; +using Module = Autofac.Module; + namespace Nitride; /// @@ -99,6 +101,31 @@ public class NitrideBuilder .RunAsync(); } + /// + /// Initialize the builder with a given Autofac module. + /// + /// The type of module to use. + /// The builder to chain operations. + public NitrideBuilder UseModule() + where TModule : Module, new() + { + this.ConfigureContainer(x => x.RegisterModule()); + + return this; + } + + /// + /// Initialize the builder with a given Autofac module. + /// + /// The type of module to use. + /// The builder to chain operations. + public NitrideBuilder UseModule(Module module) + { + this.ConfigureContainer(x => x.RegisterModule(module)); + + return this; + } + /// /// Sets the description of the builder. ///