using System.Net.Sockets; using Autofac; using BililiveRecorder.Core.Config.V2; #nullable enable namespace BililiveRecorder.Core { public class CoreModule : Module { public CoreModule() { } protected override void Load(ContainerBuilder builder) { builder.Register(x => x.Resolve().Config).As(); builder.Register(x => x.Resolve().Global).As(); builder.RegisterType().AsSelf().InstancePerMatchingLifetimeScope("recorder_root"); builder.RegisterType().AsSelf().ExternallyOwned(); builder.RegisterType().As().ExternallyOwned(); builder.RegisterType().As().ExternallyOwned(); builder.RegisterType().As().ExternallyOwned(); builder.RegisterType().As().InstancePerMatchingLifetimeScope("recorder_root"); } } }