Skip to content

Add debug information for Scopes #993

@dotnetjunkie

Description

@dotnetjunkie

Currently, it's hard to see if multiple Scope references point to the same scope, or to different instances. It would, therefore, be useful, for debugging purposes to see a unique instance number, just like Container instances already have an unique internal id. For instance something like:

private readonly long id;

public override ToString()
{
    if (this.ParentScope is null && this.Container is null)
    {
         return "Scope #" + this.id;
    }
    
    if (this.ParentScope is null)
    {
         return "Scope #" + this.id + " for Container #" + this.Container.Id;
    }

    return "Scope #" + this.id + " for Parent #" + this.ParentScope.Id + 
        " for Container #" + this.Container.Id;
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions