C# version 7.0 was released with Visual Studio 2017. Here is my list of favorite additions:
Tuples
There are plenty of times when I need a simple light-weight type containing multiple fields. Being generics make them super simple to work with.
async Main method
It sure helps to now have Main be defined async. So this:static int Main() { return DoAsyncWork().GetAwaiter().GetResult(); }
Can now become:
static async Task<int> Main() { return await DoAsyncWork(); }
private protected access modifier
(from MS documentation:)
A new compound access modifier: private protected
indicates that a member may be accessed by containing class or derived classes that are declared in the same assembly. While protected internal
allows access by derived classes or classes that are in the same assembly, private protected
limits access to derived types declared in the same assembly.