Exemplo n.º 1
0
        public static void AddScheduleIoMongoDb(this IServiceCollection services, MongoDBConfig mongoDBConfig)
        {
            DataBaseConfigurationHelper.SetDataBaseConfig(mongoDBConfig);

            services.AddScoped <ScheduleioContext>();
            services.AddScoped <IEventSourcingRepository, EventSourcingRepository>();

            services.AddScoped <IAgendaRepository, AgendaRepository>();
            services.AddScoped <IUsuarioRepository, UsuarioRepository>();
            services.AddScoped <IEventoRepository, EventoRepository>();
            services.AddScoped <ITipoEventoRepository, TipoEventoRepository>();
            services.AddScoped <ILocalRepository, LocalRepository>();
            services.AddScoped <IUnitOfWork, UoW.UnitOfWork>();
        }
Exemplo n.º 2
0
        public static void AddScheduleioSqlServerDb(this IServiceCollection services, SqlServerDBConfig sqlServerDBConfig)
        {
            DataBaseConfigurationHelper.SetDataBaseConfig(sqlServerDBConfig);

            services.AddDbContext <AgendaContext>(options =>
                                                  options.UseSqlServer(sqlServerDBConfig.ConnectionsString));

            services.AddScoped <AgendaContext>();
            services.AddScoped <IEventSourcingRepository, EventSourcingRepository>();
            services.AddScoped <IAgendaRepository, AgendaRepository>();
            services.AddScoped <IUsuarioRepository, UsuarioRepository>();
            services.AddScoped <ILocalRepository, LocalRepository>();
            services.AddScoped <ITipoEventoRepository, TipoEventoRepository>();
            services.AddScoped <IEventoRepository, EventoRepository>();
            services.AddScoped <IUnitOfWork, UoW.UnitOfWork>();
        }
Exemplo n.º 3
0
        public static void AddScheduleIoRavenDb(this IServiceCollection services, RavenDBConfig ravenDBConfig)
        {
            DataBaseConfigurationHelper.SetDataBaseConfig(ravenDBConfig);

            services
            .AddRavenDbDocStore(options =>
                                options.Settings = new RavenSettings()
            {
                Urls         = ravenDBConfig.Urls,
                CertFilePath = ravenDBConfig.CertificateFilePath,
                DatabaseName = ravenDBConfig.DataBase,
                CertPassword = ravenDBConfig.CertificatePassword
            })
            .AddRavenDbSession();

            services.AddScoped <IEventSourcingRepository, EventSourcingRepository>();

            services.AddScoped <IAgendaRepository, AgendaRepository>();
            services.AddScoped <ITipoEventoRepository, TipoEventoRepository>();
            services.AddScoped <IUsuarioRepository, UsuarioRepository>();
            services.AddScoped <IEventoRepository, EventoRepository>();
            services.AddScoped <ILocalRepository, LocalRepository>();
            services.AddScoped <IUnitOfWork, UoW.UnitOfWork>();
        }