public static MagnetServerBuilder AddSignalR(
     this MagnetServerBuilder builder)
 {
     builder.Services.AddSignalR();
     builder.Services.AddSingleton <MessageListener>();
     return(builder);
 }
Beispiel #2
0
 public static MagnetServerBuilder AddAzureDevOps(this MagnetServerBuilder builder)
 {
     builder.Services.AddControllers()
     .AddApplicationPart(typeof(WorkItemController).Assembly);
     builder.Services.AddSingleton <WorkItemEventDeserializer>();
     return(builder);
 }
Beispiel #3
0
        public static MagnetServerBuilder AddRabbitMQ(
            this MagnetServerBuilder builder,
            IConfiguration configuration)
        {
            IConfigurationSection section = configuration.GetSection("Magnet:RabbitMQ");
            RabbitMQOptions       options = section.Get <RabbitMQOptions>();

            builder.AddRabbitMQ(options);
            return(builder);
        }
        public static MagnetServerBuilder AddMagnet(this IServiceCollection services)
        {
            var builder = new MagnetServerBuilder(services);

            services.AddSingleton <IMessageSink, MessageSink>();
            services.AddSingleton <IMessageStore, InMemoryMessageStore>();
            services.AddSingleton <DataChangeTracker>();
            services.AddAutoMapper(typeof(MappingProfile));
            return(builder);
        }
Beispiel #5
0
        public static MagnetServerBuilder AddRabbitMQ(
            this MagnetServerBuilder builder,
            RabbitMQOptions options)
        {
            builder.Services.AddSingleton(options);
            builder.Services.AddSingleton <IMessageBus, MessageBus>();

            var conn = new ConnectionFactory()
            {
                HostName = options.Hostname,
                Port     = options.Port
            };

            if (options.UserName != null)
            {
                conn.UserName = options.UserName;
                conn.Password = options.Password;
            }

            builder.Services.AddSingleton(conn);
            return(builder);
        }
 public static MagnetServerBuilder AddSendGridEmail(this MagnetServerBuilder builder)
 {
     builder.Services.AddControllers()
     .AddApplicationPart(typeof(EmailController).Assembly);
     return(builder);
 }
Beispiel #7
0
 public static MagnetServerBuilder AddTwilioSms(this MagnetServerBuilder builder)
 {
     builder.Services.AddControllers()
     .AddApplicationPart(typeof(SmsController).Assembly);
     return(builder);
 }