public static IServiceCollection AddAzureEventHubReceiver <T>(this IServiceCollection services, AzureEventHubOptions options) { services.AddTransient <IMessageReceiver <T> >(x => new AzureEventHubReceiver <T>( options.ConnectionString, options.Hubs[typeof(T).Name], options.StorageConnectionString, options.StorageContainerNames[typeof(T).Name])); return(services); }
private static IServiceCollection AddAzureEventHubReceiver <TKey, TValue>(this IServiceCollection services, AzureEventHubOptions options) { services.AddTransient <IMessageReceiver <TKey, TValue> >(x => new AzureEventHubReceiver <TKey, TValue>( options.ConnectionString, options.HubName, options.ConsumerGroup)); return(services); }
public static IServiceCollection AddAzureEventHubSender <T>(this IServiceCollection services, AzureEventHubOptions options) { services.AddSingleton <IMessageSender <T> >(new AzureEventHubSender <T>( options.ConnectionString, options.Hubs[typeof(T).Name])); return(services); }
private static IServiceCollection AddAzureEventHubSender <TKey, TValue>(this IServiceCollection services, AzureEventHubOptions options) { services.AddSingleton <IMessageSender <TKey, TValue> >(new AzureEventHubSender <TKey, TValue>( options.ConnectionString, options.HubName)); return(services); }