Permalink
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (19 sloc) 722 Bytes

Use C# 6.0 dictionary initializer

Property Value
Id RR0191
Title Use C# 6.0 dictionary initializer
Syntax collection initializer
Enabled by Default

Usage

Before

var dic = new Dictionary<int, string>() { { 0, "0" } };

After

var dic = new Dictionary<int, string>() { [0] = "0" };

See Also

(Generated with DotMarkdown)