Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.35 KB

RR0204.md

File metadata and controls

47 lines (36 loc) · 1.35 KB

Generate property for DebuggerDisplay attribute

Property Value
Id RR0204
Title Generate property for DebuggerDisplay attribute
Syntax DebuggerDisplay attribute
Enabled by Default

Usage

Before

[DebuggerDisplay("A: {A} B: {B}")]
public class Foo
{
    public string A { get; }
    public string B { get; }
}

After

DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Foo
{
    public string A { get; }
    public string B { get; }

    [DebuggerBrowsable(DebuggerBrowsableState.Never)]
    private string DebuggerDisplay
    {
        get { return $"A: {A} B: {B}"; }
    }
}

See Also

(Generated with DotMarkdown)