Skip to content

Feature: Sharing data using the InvocationContext #2084

@tmds

Description

@tmds

Can you something similar to HttpContext.Items which enables sharing data between different methods that work on the InvocationContext?

public class InvocationContext
{
     public IDictionary<string, object> Items { get; }
}

My request comes from wanting to break up handling into several steps.
This provides a way to pass data between the steps.

I can imagine, you could also use this to track things like a ConfigurationManager or an IServiceCollection, enabling to implement configuration or dependency injection external to the core System.CommandLine package.

cc @jonsequitur @adamsitnik @KathleenDollard

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions