src/BeatPulse/ServiceCollectionExtensions.cs
/// <summary>
/// Add BeatPulse services to the container,
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add the BeatPulse services.</param>
/// <param name="setup">Provided delegate to configure <see cref="BeatPulseContext"/> with required BeatPulse Liveness.</param>
/// <returns>The <see cref="IServiceCollection"/> with BeatPulse added.</returns>
Add BeatPulse services to the container.
Add BeatPulse services to the container .
public static IServiceCollection AddBeatPulse(this IServiceCollection services, Action<BeatPulseContext> setup = null)
        {
            var context = new BeatPulseContext();
            context.AddLiveness(BeatPulseKeys.BEATPULSE_SELF_NAME, opt =>
            {
                opt.UsePath(BeatPulseKeys.BEATPULSE_SELF_SEGMENT);
                opt.UseLiveness(new ActionLiveness((cancellationToken) =>
                {
                    return Task.FromResult(
                        LivenessResult.Healthy());
                }));
            });
            setup?.Invoke(context);
            services.TryAddSingleton(context);
            services.TryAddSingleton<IBeatPulseService, BeatPulseService>();
            services.TryAddSingleton<IBeatPulseAuthenticationFilter, NoAuthenticationFilter>();
            return services;
        }
public static IServiceCollection AddBeatPulse ( this IServiceCollection services , Action < BeatPulseContext > setup = null ) { var context = new BeatPulseContext ( ) ; context . AddLiveness ( BeatPulseKeys . BEATPULSE_SELF_NAME , opt => { opt . UsePath ( BeatPulseKeys . BEATPULSE_SELF_SEGMENT ) ; opt . UseLiveness ( new ActionLiveness ( ( cancellationToken ) => { return Task . FromResult ( LivenessResult . Healthy ( ) ) ; } ) ) ; } ) ; setup ? . Invoke ( context ) ; services . TryAddSingleton ( context ) ; services . TryAddSingleton < IBeatPulseService , BeatPulseService > ( ) ; services . TryAddSingleton < IBeatPulseAuthenticationFilter , NoAuthenticationFilter > ( ) ; return services ; }
Add BeatPulse services to the container,
Add BeatPulse services to the container
The  with BeatPulse added.
The with BeatPulse added .
IServiceCollection
this
setup
Action<BeatPulseContext>
Provided delegate to configure  with required BeatPulse Liveness.
Provided delegate to configure with required BeatPulse Liveness .
services
The  to add the BeatPulse services.
The to add the BeatPulse services .