示例#1
0
 /// <summary>Adds a singleton <see cref="gsv::MessagingClient"/> to <paramref name="services"/>.</summary>
 /// <param name="services">
 /// The service collection to add the client to. The services are used to configure the client when requested.
 /// </param>
 /// <param name="action">
 /// An optional action to invoke on the client builder. This is invoked before services from
 /// <paramref name="services"/> are used.
 /// </param>
 public static IServiceCollection AddMessagingClient(this IServiceCollection services, sys::Action <gsv::MessagingClientBuilder> action = null) =>
 services.AddSingleton(provider =>
 {
     gsv::MessagingClientBuilder builder = new gsv::MessagingClientBuilder();
     action?.Invoke(builder);
     return(builder.Build(provider));
 });
 /// <summary>Adds a singleton <see cref="tbv::BasicClient"/> to <paramref name="services"/>.</summary>
 /// <param name="services">
 /// The service collection to add the client to. The services are used to configure the client when requested.
 /// </param>
 /// <param name="action">
 /// An optional action to invoke on the client builder. This is invoked before services from
 /// <paramref name="services"/> are used.
 /// </param>
 public static IServiceCollection AddBasicClient(this IServiceCollection services, sys::Action <tbv::BasicClientBuilder> action = null) =>
 services.AddSingleton(provider =>
 {
     tbv::BasicClientBuilder builder = new tbv::BasicClientBuilder();
     action?.Invoke(builder);
     return(builder.Build(provider));
 });