useWithServices method

ChatClientBuilder useWithServices(
  1. ChatClientFactoryWithServices clientFactory
)

Adds a middleware factory to the pipeline.

This corresponds to the Use overload that receives IServiceProvider in .NET.

Implementation

ChatClientBuilder useWithServices(
    ChatClientFactoryWithServices clientFactory) {
  ArgumentError.checkNotNull(clientFactory, 'clientFactory');

  (_clientFactories ??= <ChatClientFactoryWithServices>[]).add(clientFactory);
  return this;
}