public static ContainerBuilder RegisterAll
 (
     Dictionary <Type, Type> repositoryKeyTypes,
     Type repositoryKeyTypeDefault,
     string connectionStringKeyBedrock,
     Assembly bootstrapAssembly,
     Assembly[] serviceAssemblies,
     Assembly[] domainAssemblies,
     Assembly webAssembly,
     CoreConfiguration.BedrockConfiguration bedrockConfiguration,
     IocConfiguration iocConfiguration,
     DependentType dependentType
 )
 {
     return(RegisterBase
            (
                repositoryKeyTypes,
                repositoryKeyTypeDefault,
                connectionStringKeyBedrock,
                bootstrapAssembly,
                serviceAssemblies,
                domainAssemblies,
                webAssembly,
                bedrockConfiguration,
                iocConfiguration,
                dependentType
            )
            .RegisterSecurity(iocConfiguration));
 }
示例#2
0
 public DomainService
 (
     ITemplateContext context,
     SharedConfiguration.BedrockConfiguration bedrockConfiguration
 )
     : base(bedrockConfiguration, context)
 {
 }
示例#3
0
        public static ContainerBuilder Bootstrap(DependentType dependentType, string connectionStringKeyBedrock, CoreConfiguration.BedrockConfiguration bedrockConfiguration)
        {
            DependentType = dependentType;
            ConnectionStringKeyBedrock = connectionStringKeyBedrock;
            BedrockConfiguration       = bedrockConfiguration;
            IocConfiguration           = IocConfiguration.Current;

            return(CreateContainerBuilder());
        }
 /// <summary>
 /// Registers common application dependencies
 /// </summary>
 /// <param name="bootstrapAssembly">Used to scan for types</param>
 /// <param name="serviceAssemblies">Used to scan for types</param>
 /// <param name="domainAssemblies">Used to scan for types</param>
 /// <param name="dependentType">Type of application</param>
 /// <param name="bedrockConfiguration">If NetCoreApp application, must be passed in, or registration will throw.  If Framework application, will be built here, so no need to pass in.</param>
 /// <returns>Current builder</returns>
 public static ContainerBuilder RegisterAll
 (
     Assembly bootstrapAssembly   = null,
     Assembly[] serviceAssemblies = null,
     Assembly[] domainAssemblies  = null,
     DependentType dependentType  = DependentType.Default,
     CoreConfiguration.BedrockConfiguration bedrockConfiguration = null,
     IocConfiguration iocConfiguration = null
 )
 {
     return(RegisterAll(CreateContainerBuilder(bootstrapAssembly), bootstrapAssembly, serviceAssemblies, domainAssemblies, dependentType, bedrockConfiguration, iocConfiguration));
 }
        /// <summary>
        /// Registers common application dependencies
        /// </summary>
        /// <param name="builder">Current builder</param>
        /// <param name="bootstrapAssembly">Used to scan for types</param>
        /// <param name="serviceAssemblies">Used to scan for types</param>
        /// <param name="domainAssemblies">Used to scan for types</param>
        /// <param name="dependentType">Type of application</param>
        /// <param name="bedrockConfiguration">If NetCoreApp application, must be passed in, or registration will throw.  If Framework application, will be built here, so no need to pass in.</param>
        /// <returns>Current builder</returns>
        public static ContainerBuilder RegisterAll
        (
            ContainerBuilder builder,
            Assembly bootstrapAssembly   = null,
            Assembly[] serviceAssemblies = null,
            Assembly[] domainAssemblies  = null,
            DependentType dependentType  = DependentType.Default,
            CoreConfiguration.BedrockConfiguration bedrockConfiguration = null,
            IocConfiguration iocConfiguration = null
        )
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if ((dependentType == DependentType.AspNetCore || dependentType == DependentType.NetCoreApp) && bedrockConfiguration == null)
            {
                throw new ArgumentNullException(nameof(bedrockConfiguration));
            }

            var thisAssembly       = Assembly.GetAssembly(typeof(AutofacFactory));
            var autoMapperAssembly = Assembly.GetAssembly(typeof(AutoMapperConfiguration));

            if (iocConfiguration == null)
            {
                iocConfiguration = IocConfiguration.Current;
            }

            return(builder
                   .RegisterLoggerNLog(iocConfiguration)
                   .RegisterMapperAutoMapper(iocConfiguration, bootstrapAssembly, thisAssembly, autoMapperAssembly)
                   .RegisterMapperHelper(iocConfiguration)
                   .RegisterSession(dependentType, iocConfiguration)
                   .RegisterOrmHelper(iocConfiguration)
                   .RegisterCacheProvider(bedrockConfiguration, iocConfiguration)
                   .RegisterQueueProvider(bedrockConfiguration, iocConfiguration)
                   .RegisterSerializationProvider(iocConfiguration)
                   .RegisterHasher(iocConfiguration)
                   .RegisterServices(serviceAssemblies, iocConfiguration)
                   .RegisterValidationConfigurators(domainAssemblies, iocConfiguration)
                   .RegisterEventDispatcher(dependentType, iocConfiguration)
                   .RegisterDomainEventHandlers(domainAssemblies, iocConfiguration)
                   .RegisterWebApiClient(iocConfiguration));
        }
 public static ContainerBuilder RegisterBase
 (
     Dictionary <Type, Type> repositoryKeyTypes,
     Type repositoryKeyTypeDefault,
     string connectionStringKeyTemplate,
     Assembly bootstrapAssembly,
     Assembly[] serviceAssemblies,
     Assembly[] domainAssemblies,
     Assembly webAssembly,
     CoreConfiguration.BedrockConfiguration bedrockConfiguration,
     IocConfiguration iocConfiguration,
     DependentType dependentType
 )
 {
     return(SharedIoC
            .AutofacFactory
            .RegisterAll(bootstrapAssembly, serviceAssemblies, domainAssemblies, dependentType, bedrockConfiguration)
            .RegisterDataContextTemplate(connectionStringKeyTemplate, bedrockConfiguration)
            .RegisterRepositoriesTemplate(repositoryKeyTypes, repositoryKeyTypeDefault, iocConfiguration)
            .RegisterApplicationContextTemplate());
 }
示例#7
0
        public static ContainerBuilder Bootstrap(DependentType dependentType, CoreConfiguration.BedrockConfiguration bedrockConfiguration)
        {
            var connectionStringKeyBedrock = string.Concat(typeof(AutoBootstrapper).Assembly.GetName().Name, ".ConnectionString.Template");

            return(Bootstrap(dependentType, connectionStringKeyBedrock, bedrockConfiguration));
        }
示例#8
0
 public TemplateContext(IDomainEventDispatcher domainEventDispatcher, DbContextOptions options, SharedConfiguration.BedrockConfiguration bedrockConfiguration) : base(options, domainEventDispatcher, bedrockConfiguration)
 {
 }
示例#9
0
 public TemplateContext(IDomainEventDispatcher domainEventDispatcher, string nameOrConnectionString, SharedConfiguration.BedrockConfiguration bedrockConfiguration) : base(nameOrConnectionString, domainEventDispatcher, bedrockConfiguration)
 {
 }