Example #1
0
 /// <summary>
 /// Add instance of Gcp PubSub (no interface), with PubSubConfig, to the service collection with the NamedInstance factory.
 /// </summary>
 /// <param name="services">Service collection to extend</param>
 /// <param name="key">Key to identify the named instance of the PubSub singleton.</param>
 /// <param name="config">Configuration</param>
 /// <returns>Modified service collection with the IReactiveMessenger, IMessenger and NamedInstanceFactory{T} configured.</returns>
 public static IServiceCollection AddPubSubSingletonNamed(this IServiceCollection services, string key, PubSubConfig config)
 {
     return(AddNamedInstance <PubSubMessenger>(services, key, new PubSubMessenger(config)));
 }
Example #2
0
 /// <summary>
 /// Add instance of Gcp PubSub (with messaging interface), with PubSubConfig, to the service collection with the NamedInstance factory.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="services">Service collection to extend</param>
 /// <param name="key">Key to identify the named instance of the PubSub singleton.</param>
 /// <param name="config">Configuration</param>
 /// <returns>Modified service collection with the IReactiveMessenger, IMessenger and NamedInstanceFactory{T} configured.</returns>
 public static IServiceCollection AddPubSubSingletonNamed <T>(this IServiceCollection services, string key, PubSubConfig config)
     where T : IMessageOperations
 {
     return(AddNamedInstance <T>(services, key, new PubSubMessenger(config)));
 }