Table of Contents

Class ServiceCollectionExtensions

Namespace
Codebelt.Extensions.BenchmarkDotNet
Assembly
Codebelt.Extensions.BenchmarkDotNet.dll

Extension methods for the IServiceCollection interface.

public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions

Methods

AddBenchmarkWorkspace(IServiceCollection, Action<BenchmarkWorkspaceOptions>)

Adds the default benchmark workspace implementation (BenchmarkWorkspace) to the specified IServiceCollection

public static IServiceCollection AddBenchmarkWorkspace(this IServiceCollection services, Action<BenchmarkWorkspaceOptions> setup = null)

Parameters

services IServiceCollection

The IServiceCollection to add the services to.

setup Action<BenchmarkWorkspaceOptions>

The BenchmarkWorkspaceOptions which may be configured.

Returns

IServiceCollection

The original IServiceCollection instance for chaining.

AddBenchmarkWorkspace<TWorkspace>(IServiceCollection, Action<BenchmarkWorkspaceOptions>)

Adds a benchmark workspace implementation of type TWorkspace to the specified IServiceCollection

public static IServiceCollection AddBenchmarkWorkspace<TWorkspace>(this IServiceCollection services, Action<BenchmarkWorkspaceOptions> setup = null) where TWorkspace : class, IBenchmarkWorkspace

Parameters

services IServiceCollection

The IServiceCollection to add the services to.

setup Action<BenchmarkWorkspaceOptions>

The BenchmarkWorkspaceOptions which may be configured.

Returns

IServiceCollection

The original IServiceCollection instance for chaining.

Type Parameters

TWorkspace

The type that implements the IBenchmarkWorkspace interface.

Remarks

Validates the services parameter and the provided setup configurator. Registers IBenchmarkWorkspace as a singleton using TWorkspace, applies the provided configuration, and registers the resolved BenchmarkWorkspaceOptions as a singleton.