Example #1
0
        public static CapOptions UseSqlServer(this CapOptions options, Action <SqlServerOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            options.RegisterExtension(new SqlServerCapOptionsExtension(configure));

            return(options);
        }
Example #2
0
        /// <summary>
        /// Extension to use ActiveMQ with configuration action
        /// </summary>
        /// <param name="options">Cap options</param>
        /// <param name="configure">configuration action</param>
        /// <returns>Cap options</returns>
        public static CapOptions UseActiveMQ(this CapOptions options, Action <ActiveMQOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            options.RegisterExtension(new ActiveMQCapOptionsExtension(configure));

            return(options);
        }
        public static CapOptions UseDashboard(this CapOptions capOptions, Action <DashboardOptions> options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            capOptions.RegisterExtension(new DashboardOptionsExtension(options));

            return(capOptions);
        }
Example #4
0
        public static CapOptions UsePostgreSql(this CapOptions options, Action <PostgreSqlOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            options.RegisterExtension(new PostgreSqlCapOptionsExtension(configure));

            return(options);
        }
        public static CapOptions UseRedis(this CapOptions options, Action <CapRedisOptions> configure)
        {
            if (configure is null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            options.RegisterExtension(new RedisOptionsExtension(configure));

            return(options);
        }
        public static CapOptions UseMySql(this CapOptions options, Action <MySqlOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            configure += x => x.Version = options.Version;

            options.RegisterExtension(new MySqlCapOptionsExtension(configure));

            return(options);
        }
        public static CapOptions UseEntityFramework <TContext>(this CapOptions options, Action <EFOptions> configure)
            where TContext : DbContext
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            options.RegisterExtension(new MySqlCapOptionsExtension(x =>
            {
                configure(x);
                x.DbContextType = typeof(TContext);
            }));

            return(options);
        }
Example #8
0
        public static CapOptions UseEntityFramework <TContext>(this CapOptions options, Action <EFOptions> configure)
            where TContext : DbContext
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var efOptions = new EFOptions {
                DbContextType = typeof(TContext)
            };

            configure(efOptions);

            options.RegisterExtension(new PostgreSqlCapOptionsExtension(configure));

            return(options);
        }
Example #9
0
 public static CapOptions UseFakeTransport(this CapOptions options)
 {
     options.RegisterExtension(new FakeQueueOptionsExtension());
     return(options);
 }
Example #10
0
 public static CapOptions UseInMemoryStorage(this CapOptions options)
 {
     options.RegisterExtension(new InMemoryCapOptionsExtension());
     return(options);
 }
Example #11
0
 /// <summary>
 /// Configuration to use In-Memory message queue in CAP.
 /// </summary>
 /// <param name="options">CAP configuration options</param>
 public static CapOptions UseInMemoryMessageQueue(this CapOptions options)
 {
     options.RegisterExtension(new InMemoryMqOptionsExtension());
     return(options);
 }
 public static CapOptions UseLiteDBStorage(this CapOptions options, Action <LiteDBOptions> configure)
 {
     options.RegisterExtension(new LiteDBCapOptionsExtension(configure));
     return(options);
 }