public static ProphetBuilder AddProphet(this IServiceCollection services, ProphetConfig prophetConfig) => new ProphetBuilder(services, prophetConfig);
public ProphetBuilder(IServiceCollection services, ProphetConfig prophetConfig) { services.AddDbContext <ProphetContext>(prophetConfig.DbContextOptions); services.AddHostedService(provider => new ProphetService(provider, prophetConfig.BoostrapServers, prophetConfig.Topic, prophetConfig.Group)); }