Skip to content

NeedlrBootstrapContext

NexusLabs.Needlr.Hosting

NeedlrBootstrapContext Class

Contextual data passed to the RunAsync(Func<NeedlrBootstrapContext,CancellationToken,Task>, CancellationToken) callback. Provides access to a bootstrap logger that is available before the DI container is built.

public sealed record NeedlrBootstrapContext : System.IEquatable<NexusLabs.Needlr.Hosting.NeedlrBootstrapContext>

Inheritance System.Object 🡒 NeedlrBootstrapContext

Implements System.IEquatable<NeedlrBootstrapContext>

Example

await new NeedlrBootstrapper().RunAsync(async (ctx, ct) =>
{
    ctx.Logger.LogInformation("Application starting...");
    // build your host, run your app, etc.
});

Properties

NeedlrBootstrapContext.Logger Property

Gets the bootstrap logger, available before the DI container is configured.

public Microsoft.Extensions.Logging.ILogger Logger { get; init; }

Property Value

Microsoft.Extensions.Logging.ILogger