public static ILifetimeScope ConfigureContainer(RunMode mode)
        {
            var builder = ConfigureDI.ConfigureContainerWithCommonModules(mode);

            builder.RegisterModule <ProjectVacanciesForSoc.AutofacModule>();
            return(builder.Build().BeginLifetimeScope());
        }
        /// <summary>
        /// Configures the container.
        /// </summary>
        /// <param name="mode">The mode.</param>
        /// <returns></returns>
        public static ILifetimeScope ConfigureContainer(RunMode mode)
        {
            var builder = ConfigureDI.ConfigureContainerWithCommonModules(mode);

            builder.RegisterType <InMemoryAuditService>().As <IAuditService>();
            builder.RegisterModule <AutofacModule>();
            builder.RegisterModule <Repository.Sitefinity.AutofacModule>();
            return(builder.Build().BeginLifetimeScope());
        }
        public static ILifetimeScope ConfigureContainer(RunMode mode, string basePath)
        {
            var builder = ConfigureDI.ConfigureContainerWithCommonModules(mode, basePath);

            builder.RegisterModule <EmailNotificationAutofacModule>();
            builder.RegisterModule <AccountsRepositoryAutofacModule>();
            builder.RegisterModule <GovUkNotifyAutofacModule>();
            builder.RegisterModule <AccountsServiceAutofacModule>();
            return(builder.Build().BeginLifetimeScope());
        }
Пример #4
0
        public static ILifetimeScope ConfigureContainer(RunMode mode)
        {
            var builder = ConfigureDI.ConfigureContainerWithCommonModules(mode);

            builder.RegisterType <InMemoryAuditService>().As <IAuditService>().SingleInstance();
            builder.RegisterModule <Repository.Sitefinity.AutofacModule>();
            builder.RegisterModule <GetMappings.AutofacModule>();
            //builder.Register(ctx => ctx.Resolve<MapperConfiguration>().CreateMapper()).As<IMapper>();

            return(builder.Build().BeginLifetimeScope());
        }
Пример #5
0
        public static ILifetimeScope ConfigureContainer(RunMode mode, IAsyncCollector <AuditRecord <object, object> > asyncCollector, AuditRecord <object, object> masterRecord)
        {
            var builder = ConfigureDI.ConfigureContainerWithCommonModules(mode);

            builder.RegisterModule <AutofacModule>();
            builder.RegisterModule <Repository.Sitefinity.AutofacModule>();
            if (mode == RunMode.Azure)
            {
                builder.Register(ctx => new CosmosAuditService(asyncCollector, masterRecord)).As <IAuditService>();
            }
            return(builder.Build().BeginLifetimeScope());
        }
        /// <summary>
        /// Configures the container.
        /// </summary>
        /// <param name="mode">The mode.</param>
        /// <returns></returns>
        public static ILifetimeScope ConfigureContainer(RunMode mode, IAsyncCollector <AuditRecord <object, object> > asyncCollector, AuditRecord <object, object> masterRecord)
        {
            var builder = ConfigureDI.ConfigureContainerWithCommonModules(mode);

            if (mode == RunMode.Azure)
            {
                builder.Register(ctx => new CosmosAuditService(asyncCollector, masterRecord)).As <IAuditService>();
            }
            builder.RegisterModule <Core.AutofacModule>();
            builder.RegisterModule <GetAVDetailsForProjectedAV.AutofacModule>();
            builder.RegisterModule <Service.AutofacModule>();
            return(builder.Build().BeginLifetimeScope());
        }