Skip to content

ReplServiceCollectionExtensions

Extension methods to register a ReplApp in an IServiceCollection.

public static class ReplServiceCollectionExtensions

AddRepl(IServiceCollection, PreparedReplStartup, Action<IServiceCollection>, Action<IServiceProvider, ReplApp>)

Section titled “AddRepl(IServiceCollection, PreparedReplStartup, Action<IServiceCollection>, Action<IServiceProvider, ReplApp>)”

Registers a prepared application without building the caller’s provider.

public static IServiceCollection AddRepl(this IServiceCollection services, PreparedReplStartup prepared, Action<IServiceCollection> configureServices, Action<IServiceProvider, ReplApp> configure)
  • services (IServiceCollection): Caller-owned service collection.
  • prepared (PreparedReplStartup): Successful preparation.
  • configureServices (Action<IServiceCollection>): Application service registration, before provider construction.
  • configure (Action<IServiceProvider, ReplApp>): Application mapping, with the completed host provider.

IServiceCollection - The collection.

AddRepl(IServiceCollection, Action<IServiceCollection>, Action<ReplApp>)

Section titled “AddRepl(IServiceCollection, Action<IServiceCollection>, Action<ReplApp>)”

Creates and registers a singleton ReplApp in the service collection.

public static IServiceCollection AddRepl(this IServiceCollection services, Action<IServiceCollection> configureReplServices, Action<ReplApp> configure)
  • services (IServiceCollection): Target service collection.
  • configureReplServices (Action<IServiceCollection>): Callback to register REPL-specific services.
  • configure (Action<ReplApp>): Callback to configure the REPL application (map commands, profiles, etc.).

IServiceCollection - The same service collection for chaining.

AddRepl(IServiceCollection, Action<ReplApp>)

Section titled “AddRepl(IServiceCollection, Action<ReplApp>)”

Creates and registers a singleton ReplApp in the service collection.

public static IServiceCollection AddRepl(this IServiceCollection services, Action<ReplApp> configure)
  • services (IServiceCollection): Target service collection.
  • configure (Action<ReplApp>): Callback to configure the REPL application (map commands, profiles, etc.).

IServiceCollection - The same service collection for chaining.

AddRepl(IServiceCollection, Action<IServiceProvider, ReplApp>)

Section titled “AddRepl(IServiceCollection, Action<IServiceProvider, ReplApp>)”

Creates and registers a singleton ReplApp using deferred configuration with access to the host’s IServiceProvider. This allows REPL modules to be resolved from the host’s DI container.

public static IServiceCollection AddRepl(this IServiceCollection services, Action<IServiceProvider, ReplApp> configure)
  • services (IServiceCollection): Target service collection.
  • configure (Action<IServiceProvider, ReplApp>): Callback receiving the host service provider and the REPL application.

IServiceCollection - The same service collection for chaining.