示例#1
0
 public CAPMysqlPublisher(ICapPublisher inner, CAPService capService)
 {
     _inner      = inner;
     _capService = capService;
 }
示例#2
0
 public CAPMysqlDbContext(CAPService capService)
 {
     _capService = capService;
 }
示例#3
0
        public static IServiceCollection AddCAPService(this IServiceCollection services, CAPService capService)
        {
            services.AddSingleton(capService);
            // add dbcontext
            services.AddDbContext <CAPMysqlDbContext>();

            // add cap and inject ICapPublisher instance
            services.AddCap(x =>
            {
                x.UseEntityFramework <CAPMysqlDbContext>()
                .UseKafka(capService.Host)
                .UseDashboard();
            });

            //TODO: you can replace your own publisher here
            services.AddTransient <ICAPPublisher, CAPMysqlPublisher>();

            return(services);
        }
示例#4
0
 public static IServiceCollection AddRabbitService(this IServiceCollection services, CAPService capService)
 {
     throw new System.NotImplementedException("rabbit serivce will coming soon");
 }