コード例 #1
0
        public static ISImplHostBuilder UseCqrsInMemoryEventDispatcher(this ISImplHostBuilder host)
        {
            var module = host.AttachNewOrGetConfiguredModule(() => new EventModule(new EventModuleConfig()));

            module.Config.EnableInMemoryEventDispatcher = true;
            return(host);
        }
コード例 #2
0
        public static ISImplHostBuilder UseCqrsEvents(this ISImplHostBuilder host, Action <EventModuleConfig> configureDelegate = null)
        {
            var module = host.AttachNewOrGetConfiguredModule(() => new EventModule(new EventModuleConfig()));

            configureDelegate?.Invoke(module.Config);

            return(host);
        }
コード例 #3
0
        public static ISImplHostBuilder UseRedis(this ISImplHostBuilder host, Action <RedisConfig> configureDelegate)
        {
            var module = host.AttachNewOrGetConfiguredModule(() => new RedisModule(new RedisConfig()));

            configureDelegate?.Invoke(module.Config);

            return(host);
        }
コード例 #4
0
        public static ISImplHostBuilder UseCqrsMessagingCommandDispatcher(this ISImplHostBuilder host, Action <MessagingCqrsModuleConfig> configureDelegate)
        {
            var module = host.AttachNewOrGetConfiguredModule(() => new MessagingCqrsModule(new MessagingCqrsModuleConfig()));

            configureDelegate?.Invoke(module.Config);

            return(host);
        }
コード例 #5
0
        public static ISImplHostBuilder UseTransactionalRequests(this ISImplHostBuilder host, Action <HttpStorageModuleConfig> configureDelegate = null)
        {
            var module = host.AttachNewOrGetConfiguredModule(() => new HttpStorageModule(new HttpStorageModuleConfig()));

            configureDelegate?.Invoke(module.Config);

            return(host);
        }
コード例 #6
0
        public static ISImplHostBuilder UseNPocoRepositoryStorage(this ISImplHostBuilder host, Action <NPocoRepositoryConfig> dapperRepoConfig = null)
        {
            var config = new NPocoRepositoryConfig();

            dapperRepoConfig?.Invoke(config);

            host.AttachNewOrGetConfiguredModule(() => new NPocoRepositoryModule(config));
            return(host);
        }
コード例 #7
0
        private static HttpOAuthConfig Attach(ISImplHostBuilder simplHostBuilder)
        {
            var config      = new HttpOAuthConfig(simplHostBuilder);
            var oauthModule = new HttpOAuthModule(config);

            simplHostBuilder.AttachNewOrGetConfiguredModule(() => oauthModule);

            return(config);
        }
コード例 #8
0
        private static ExamineConfig AttachModule(ISImplHostBuilder simplHostBuilder)
        {
            var config = new ExamineConfig();
            var module = new ExamineModule(config);

            simplHostBuilder.AttachNewOrGetConfiguredModule <ExamineModule>(() => module);

            return(config);
        }
コード例 #9
0
        public static ISImplHostBuilder UseDependencyInjection(this ISImplHostBuilder host, Action <DependencyInjectionConfig> queueConfig)
        {
            var config = new DependencyInjectionConfig();

            queueConfig.Invoke(config);

            var module = host.AttachNewOrGetConfiguredModule(() => new DependencyInjectionModule(config));

            return(host);
        }
コード例 #10
0
        public static ISImplHostBuilder UseInMemoryQueues(this ISImplHostBuilder host, Action <QueueModuleConfig> queueConfig)
        {
            var config = new QueueModuleConfig();

            queueConfig.Invoke(config);

            var module = host.AttachNewOrGetConfiguredModule(() => new QueueModule(config));

            module.Config.EnableInMemoryQueueManager = true;

            return(host);
        }
コード例 #11
0
        public static void ConfigureWebHostStackApp(this ISImplHostBuilder hostBuilder, Action <IWebHostBuilder> configureDelegate)
        {
            // Configure Generic host
            var startupConfiguration   = new WebHostStartupConfiguration();
            var applicationHostBuilder = new WebHostBuilder(startupConfiguration);

            configureDelegate?.Invoke(applicationHostBuilder);

            // Get startup and application builder
            var startup = startupConfiguration.GetConfiguredStartup();
            var stackApplicationBuilder = RuntimeServices.Current.BootContainer.New <WebHostApplicationBuilder>();

            // attach application
            hostBuilder.AttachNewOrGetConfiguredModule(() => new WebHostStackApplicationModule(stackApplicationBuilder, startup.ConfigureStackApplication, startup.ConfigureServices));
        }
コード例 #12
0
        public static ISImplHostBuilder ConfigureWebHostStackApp(this ISImplHostBuilder hostBuilder, Action <IWebHostBuilder> configureDelegate = null)
        {
            // Configure Generic host
            var startupConfiguration   = new WebHostStartupConfiguration();
            var applicationHostBuilder = RuntimeServices.Current.BootContainer.New <WebHostBuilder>(new Dictionary <Type, object>
            {
                [typeof(WebHostStartupConfiguration)] = startupConfiguration
            });

            configureDelegate?.Invoke(applicationHostBuilder);

            // Get startup and application builder
            var startup = startupConfiguration.GetConfiguredStartup();
            var stackApplicationBuilder = RuntimeServices.Current.BootContainer.New <WebHostApplicationBuilder>();

            // attach application
            hostBuilder.AttachNewOrGetConfiguredModule(() => new WebHostStackApplicationModule(stackApplicationBuilder, startup.ConfigureStackApplication, startup.ConfigureServices));

            return(hostBuilder);
        }
コード例 #13
0
 public static ISImplHostBuilder UseCqrsMessagingCommandDispatcher(this ISImplHostBuilder host)
 {
     host.AttachNewOrGetConfiguredModule(() => new MessagingCqrsModule());
     return(host);
 }
コード例 #14
0
 public TModule AttachNewOrGetConfiguredModule <TModule>(Func <TModule> factory)
     where TModule : ISImplModule
 {
     return(_hostBuilder.AttachNewOrGetConfiguredModule(factory));
 }
コード例 #15
0
        public static ISImplHostBuilder UseInMemoryRepositoryStorage(this ISImplHostBuilder host)
        {
            host.AttachNewOrGetConfiguredModule(() => new RepositoryModule());

            return(host);
        }
コード例 #16
0
 public static TModule AttachNewOrGetConfiguredModule <TModule>(this ISImplHostBuilder stackHostBuilder)
     where TModule : ISImplModule, new()
 {
     return(stackHostBuilder.AttachNewOrGetConfiguredModule(() => new TModule()));
 }
コード例 #17
0
        public static ISImplHostBuilder UseInMemoryKeyValueStorage(this ISImplHostBuilder host)
        {
            host.AttachNewOrGetConfiguredModule(() => new KeyValueModule());

            return(host);
        }
コード例 #18
0
 public static TModule AttachNewOrGetConfiguredModule <TModule>(this ISImplHostBuilder stackHostBuilder, TModule module)
     where TModule : ISImplModule
 {
     return(stackHostBuilder.AttachNewOrGetConfiguredModule(() => module));
 }