Пример #1
0
        private static void RegisterConfig(ContainerBuilder cb)
        {
            cb.Register(c => new ProgramContext(
                            cancellationTokenSource: new CancellationTokenSource(),
                            operationSystem: OSUtils.GetOperationSystem())
                        ).AsSelf().SingleInstance();

            cb.Register(c => new AppConfig(
                            runFrequency: TimeSpan.FromMinutes(1),
                            timeZoneInfo: TimeZoneInfo.Local)
                        ).AsSelf().SingleInstance();

            cb.Register(c => new RunConfig(DateTime.UtcNow)).AsSelf().InstancePerLifetimeScope();
        }