There, the sentence / code refactoring hidden there tells you that what you wrote can also be written in some other form when the same functionality is achieved.
To C # 7, i.e. VS 2017, it was a way of recording, but with C # 7 built-in outputs you can reduce it to
return TryGetValue(key, out TValue value) ? value : defaultValue;
You can also declare it var , which was not possible before. So you can write it like
return TryGetValue(key, out var value) ? value : defaultValue;
How to achieve this
Hover over ... and you will see this sentence in two ways.
- Press
Ctrl + .
OR - A roslyn ball will appear, and you can click on it, and the drop-down menu will offer you the same.
source share