예제 #1
0
        public static ContainerBuilder AddModule(this ContainerBuilder builder, Module.Configurations configurations,
                                                 IEventBus eventBus)
        {
            builder.Register <Module>(ctx => new UserAccountModule(configurations, eventBus)).SingleInstance();

            return(builder);
        }
예제 #2
0
        public UserAccountDataContext(Module.Configurations configuration)
        {
            this._schema = "UserAccount";

            this._configuration    = configuration;
            this._connectionString = configuration.DataConnectionString;

            base.Database.Migrate();
        }
예제 #3
0
        public UserAccountDataContext CreateDbContext(string[] args)
        {
            var configurations = new Module.Configurations
            {
                DefaultAccount = new Module.Configurations.DefaultUserAccount
                {
                    Name     = "Admin",
                    Password = "******",
                    Email    = "*****@*****.**",
                },
                DataConnectionString = args[0]
            };

            return(new UserAccountDataContext(configurations));
        }
예제 #4
0
 public GenerateNewPasswordAutofacModule(Module.Configurations configurations, IEventBus eventBus)
 {
     this._configurations = configurations ?? throw new System.ArgumentNullException(nameof(configurations));
     this._eventBus       = eventBus ?? throw new System.ArgumentNullException(nameof(eventBus));
 }
예제 #5
0
 public CreateNewAccountAutofacModule(Module.Configurations configurations, IEventBus eventBus = null)
 {
     this._configurations = configurations;
     this._eventBus       = eventBus;
 }
예제 #6
0
 public NotifyAccountCreationAutofacModule(Module.Configurations configurations)
 {
     this._configurations = configurations ?? throw new System.ArgumentNullException(nameof(configurations));
 }
예제 #7
0
        public static IServiceCollection AddNotificationsModule(this IServiceCollection services, Module.Configurations configurations,
                                                                Module.EventsToSubscribe eventsToSubscribe, IEventBus eventBus)
        {
            var module = new NotificationModule(configurations, eventsToSubscribe, eventBus);

            services.AddSingleton(module);

            return(services);
        }
예제 #8
0
 public LoginAutofacModule(Module.Configurations configurations, IEventBus eventBus = null)
 {
     this._configurations = configurations;
 }
예제 #9
0
        public static IServiceCollection AddUserAccountModule(this IServiceCollection services, Module.Configurations configurations,
                                                              IEventBus eventBus)
        {
            services.AddSingleton <Module>(provider => new UserAccountModule(configurations, eventBus));

            return(services);
        }