C# 14 · Basics
Assign only when null
Assign a default if a variable is currently null.
cache ??= new Dictionary<string, int>();
C# 14 · Basics
Assign a default if a variable is currently null.
cache ??= new Dictionary<string, int>();
Was this page helpful?