using Medallion.Threading; using Medallion.Threading.Redis; using Microsoft.Extensions.DependencyInjection; using StackExchange.Redis; using Volo.Abp.Autofac; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.DistributedEvents; using Volo.Abp.EntityFrameworkCore.SqlServer; using Volo.Abp.EventBus.Boxes; using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.RabbitMq; using Volo.Abp.Modularity; namespace DistDemoApp { [DependsOn( typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAutofacModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEventBusBoxesModule) )] public class DistDemoAppModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); context.Services.AddHostedService(); context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); }); Configure(options => { options.UseSqlServer(); }); Configure(options => { options.EtoMappings.Add(); options.AutoEventSelectors.Add(); }); Configure(options => { options.Outboxes.Configure(config => { config.UseDbContext(); }); options.Inboxes.Configure(config => { config.UseDbContext(); }); }); context.Services.AddSingleton(sp => { var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); }); } } }