Added abstractions
Internal service bus support enabled Added quartz support Reconfigured extensions
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using LiteCharms.Abstractions;
|
||||
using LiteCharms.Infrastructure.ServiceBus;
|
||||
using LiteCharms.Infrastructure.ServiceBus.Exchanges;
|
||||
|
||||
namespace LiteCharms.Extensions;
|
||||
|
||||
public static class ServiceBus
|
||||
{
|
||||
public static IServiceCollection AddGeneralServiceBus(this IServiceCollection services) => services
|
||||
.AddSingleton<GeneralServiceBus>()
|
||||
.AddHostedService<GeneralExchange>()
|
||||
.AddKeyedTransient<IEventBus, GeneralServiceBus>(Constants.GeneralServiceBus)
|
||||
.AddMemoryCache();
|
||||
|
||||
public static IServiceCollection AddEmailServiceBus(this IServiceCollection services) => services
|
||||
.AddSingleton<EmailServiceBus>()
|
||||
.AddHostedService<EmailExchange>()
|
||||
.AddKeyedTransient<IEventBus, EmailServiceBus>(Constants.EmailServiceBus)
|
||||
.AddMemoryCache();
|
||||
|
||||
public static IServiceCollection AddSalesServiceBus(this IServiceCollection services) => services
|
||||
.AddSingleton<SalesServiceBus>()
|
||||
.AddHostedService<SalesExchange>()
|
||||
.AddKeyedTransient<IEventBus, SalesServiceBus>(Constants.SalesServiceBus)
|
||||
.AddMemoryCache();
|
||||
}
|
||||
Reference in New Issue
Block a user