예제 #1
0
        public void Build(IContainer container)
        {
            var application = new ChauffeurUmbracoApplication();

            application.Start();

            var context = ApplicationContext.Current;

            container.Register(() => context);
            container.Register(() => context.DatabaseContext);
            container.Register(() => context.DatabaseContext.Database).As <Database>();
            container.Register(() => context.DatabaseContext.SqlSyntax);
            container.Register(() => context.ProfilingLogger.Logger);
            container.Register <DatabaseSchemaHelper>();

            var services = context.Services;

            container.Register(() => services.ContentService);
            container.Register(() => services.ContentTypeService);
            container.Register(() => services.DataTypeService);
            container.Register(() => services.EntityService);
            container.Register(() => services.ExternalLoginService);
            container.Register(() => services.FileService);
            container.Register(() => services.MediaService);
            container.Register(() => services.MacroService);
            container.Register(() => services.MemberGroupService);
            container.Register(() => services.MemberService);
            container.Register(() => services.MemberTypeService);
            container.Register(() => new OverridingPackagingService(services.PackagingService, services.MacroService, services.DataTypeService, services.ContentTypeService))
            .As <IPackagingService>();
            container.Register(() => services.UserService);
        }
예제 #2
0
        public void Build(IContainer container)
        {
            var application = new ChauffeurUmbracoApplication();
            application.Start();

            var context = ApplicationContext.Current;

            container.Register(() => context.DatabaseContext);
            container.Register(() => context.DatabaseContext.Database).As<Database>();

            var services = context.Services;
            container.Register(() => services.ContentService);
            container.Register(() => services.ContentTypeService);
            container.Register(() => services.DataTypeService);
            container.Register(() => services.FileService);
            container.Register(() => services.MediaService);
            container.Register(() => services.MacroService);
            container.Register(() => services.MemberGroupService);
            container.Register(() => services.MemberService);
            container.Register(() => services.MemberTypeService);
            container.Register(() => new OverridingPackagingService(services.PackagingService, services.MacroService)).As<IPackagingService>();
            container.Register(() => services.UserService);
        }