src/Orleans.Core/Configuration/OptionLogger/OptionFormatterExtensionMethods.cs
/// <summary>
/// Configures an options formatter for <typeparamref name="TOptions"/> if none are already configured.
/// </summary>
/// <param name="services">
/// The services.
/// </param>
/// <typeparam name="TOptions">
/// The options type.
/// </typeparam>
/// <typeparam name="TOptionFormatter">
/// The option formatter type.
/// </typeparam>
/// <returns>
/// The <see cref="IServiceCollection"/>, for chaining with other calls.
/// </returns>
Configures an options formatter for  if none are already configured.
Configures an options formatter for if none are already configured .
public static IServiceCollection TryConfigureFormatter<TOptions, TOptionFormatter>(this IServiceCollection services)
            where TOptions : class
            where TOptionFormatter : class, IOptionFormatter<TOptions>
        {
            if (services.All(service => service.ServiceType != typeof(IOptionFormatter<TOptions>)))
            {
                services.ConfigureFormatter<TOptions, TOptionFormatter>();
            }
            return services;
        }
public static IServiceCollection TryConfigureFormatter < TOptions , TOptionFormatter > ( this IServiceCollection services ) where TOptions : class where TOptionFormatter : class , IOptionFormatter < TOptions > { if ( services . All ( service => service . ServiceType != typeof ( IOptionFormatter < TOptions > ) ) ) { services . ConfigureFormatter < TOptions , TOptionFormatter > ( ) ; } return services ; }
Configures an options formatter for  if none are already configured.
Configures an options formatter for if none are already configured .
The , for chaining with other calls.
The for chaining with other calls .
IServiceCollection
this
services
None
typeparam
The options type.
The options type .
typeparam
The option formatter type.
The option formatter type .