Ejemplo n.º 1
0
        public DatabaseRegistry()
        {
            For <IDbConnection>().Use(c => new SqlConnection(ConfigurationManager.ConnectionStrings["default"].ConnectionString))
            .LifecycleIs <UniquePerRequestLifecycle>();
            For <IUnitOfWork>().Use <UnitOfWork>().LifecycleIs <UniquePerRequestLifecycle>();

            // This is to populate the UnitOfWork property of UnitOfWorkAttribute
            Policies.FillAllPropertiesOfType <IUnitOfWork>().Use <UnitOfWork>();
        }
Ejemplo n.º 2
0
        public DefaultRegistry()
        {
            Scan(_ =>
            {
                _.WithDefaultConventions();
            });

            For <WSCommunication>().Singleton();

            Policies.FillAllPropertiesOfType <WSCommunication>();
            Policies.FillAllPropertiesOfType <ADStub>();
            Policies.FillAllPropertiesOfType <ReconnectJob>();

            Policies.Add <LoggingForClassPolicy>();
        }
Ejemplo n.º 3
0
        public DefaultRegistry()
        {
            Scan(_ =>
            {
                _.WithDefaultConventions();
            });

            // singleton required to persist dirsync cookie
            For <SynchronizeJob>().Singleton();

            // policies
            Policies.FillAllPropertiesOfType <ActiveDirectoryService>();
            Policies.FillAllPropertiesOfType <BackendService>();
            Policies.Add <LoggingForClassPolicy>();
        }
Ejemplo n.º 4
0
        public DefaultRegistry()
        {
            Scan(
                scan =>
            {
                scan.TheCallingAssembly();
                scan.WithDefaultConventions();
                scan.With(new ControllerConvention());
            });
            For <IFilterProvider>().Use <DependencyResolverFilterProvider>();
            Policies.FillAllPropertiesOfType <IContainer>();
            For <UnitOfWork>().Use <UnitOfWork>().Named("UnitOfWorkObject").LifecycleIs <HttpContextLifecycle>();
            For <IUnitOfWork>().Use <UnitOfWork>(x => x.GetInstance <UnitOfWork>("UnitOfWorkObject")).LifecycleIs <HttpContextLifecycle>();

            // Asp.net Identity dependencys in managers
            For <DbContext>().Use <UnitOfWork>(x => x.GetInstance <UnitOfWork>("UnitOfWorkObject"));
            For <ICategoriesRepository>().Use <CategoriesRepository>().Ctor <UnitOfWork>("context").Is(t => t.GetInstance <UnitOfWork>("UnitOfWorkObject"));
            For <ICustomersRepository>().Use <CustomersRepository>().Ctor <UnitOfWork>("context").Is(t => t.GetInstance <UnitOfWork>("UnitOfWorkObject"));
            For <IEmployeesRepository>().Use <EmployeesRepository>().Ctor <UnitOfWork>("context").Is(t => t.GetInstance <UnitOfWork>("UnitOfWorkObject"));
            For <ISuppliersRepository>().Use <SuppliersRepository>().Ctor <UnitOfWork>("context").Is(t => t.GetInstance <UnitOfWork>("UnitOfWorkObject"));
            For <MasterRepository>().Use <MasterRepository>().Ctor <UnitOfWork>("context").Is(t => t.GetInstance <UnitOfWork>("UnitOfWorkObject"));
        }
Ejemplo n.º 5
0
 public StructureMapPropertyInjectionRegistry()
 {
     Policies.SetAllProperties(setterConvention => setterConvention.WithAnyTypeFromNamespace("NServiceBus.AcceptanceTests"));
     Policies.FillAllPropertiesOfType <IMessageCreator>().Use <MessageMapper>();
 }
        public DefaultRegistry()
        {
            Scan(
                scan =>
            {
                scan.TheCallingAssembly();
                scan.WithDefaultConventions();
                scan.AssemblyContainingType <IDomainModel>();
                scan.AddAllTypesOf <IDomainModel>();
                scan.AddAllTypesOf <IMapperBase>();
                scan.ConnectImplementationsToTypesClosing(typeof(IValidationHandler <>));
            });

            Policies.FillAllPropertiesOfType <IContainer>();

            For <IValidateBus>().Use <DefaultValidateBus>();

            // Unit Of Work
            For <EfUnitOfWork>().Use <EfUnitOfWork>().Named("UnitOfWorkObject").LifecycleIs <HttpContextLifecycle>();
            For <IUnitOfWork>().Use(x => x.GetInstance <EfUnitOfWork>("UnitOfWorkObject")).LifecycleIs <HttpContextLifecycle>();

            // Domain Services
            //For<ICustomerValidationService>().Use<CustomerValidationService>();

            //Umbraco Content Service
            For <UmbracoHelper>().Use(new UmbracoHelper(UmbracoContext.Current));
            For <Examine.ExamineManager>().Use(Examine.ExamineManager.Instance);

            For <IContentService>().Use(Umbraco.Core.ApplicationContext.Current.Services.ContentService);
            For <IContentTypeService>().Use(Umbraco.Core.ApplicationContext.Current.Services.ContentTypeService);
            For <ILocalizationService>().Use(ApplicationContext.Current.Services.LocalizationService);
            For <IDomainService>().Use(ApplicationContext.Current.Services.DomainService);

            For <IMediaService>().Use(Umbraco.Core.ApplicationContext.Current.Services.MediaService);

            For <IUmbracoService>().Use <UmbracoService>();
            //For<ISearchService>().Use<SearchService>();

            For <Core.Services.TreeService.ITreeService>().Use <Infrastructure.UmbracoServices.TreeService>();

            //For<IPositionRepository>().Use<PositionRepository>()/*.Named("PositionRepository")*/.LifecycleIs<HttpContextLifecycle>();
            //For<IPositionRepository>().Use(x => x.GetInstance<EfUnitOfWork>("UnitOfWorkObject").PositionRepository).LifecycleIs<HttpContextLifecycle>();

            ////Manao Media service
            //For<IManaoMediaService>().Use<ManaoMediaService>();

            ////Cookies Alert Service
            //For<ICookiesAlertService>().Use<CookiesAlertService>();

            ////Google Analytics Service
            //For<IGoogleAnalyticsService>().Use<GoogleAnalyticsService>();

            ////SEO Service
            //For<ISEOService>().Use<SEOService>();

            ////Robots Service
            //For<IRobotsService>().Use<RobotsService>();

            ////Configuration Service
            //For<IConfigurationService>().Use<ConfigurationService>();

            ////Serializer Service
            //For<Core.Services.SerializerServices.INodeModelSerializerService>().Use<Infrastructure.SerializerServices.NodeModelSerializerService>();
            //For<Core.Services.SerializerServices.ILinkModelSerializerService>().Use<Infrastructure.SerializerServices.LinkModelSerializerService>();

            //Form Services
            For <IFieldService>().Use <FieldService>();
            For <IFormPluginService>().Use <FormPluginService>();
            For <IFormService>().Use <FormService>();
            For <IIntegrationService>().Use <IntegrationService>();
            For <ILogService>().Use <LogService>();
        }
Ejemplo n.º 7
0
 public TypeRegistry()
 {
     For <ILogger>().Singleton().Use <Log4NetLogger>();
     Policies.FillAllPropertiesOfType <ILogger>().Use <Log4NetLogger>();
 }