7

I suspect it has something to do with the nullable reference types introduced in C# 8, but I cannot find the documentation on this operator.

I stumbled upon it in the dotnet/corefx repo in linq code:

_enumerator = GetEnumerable(0)!.GetEnumerator();

GetEnumerable returns IEnumerable<T>?, so I suspect this will have somthing to do with the nullable ?.

But what does the !. actually do?

Pointing me to some documentation would be the best for me, some concise tutorial would be also appreciated (but I tend to like official documentation more). No tutorial I have found in my quick search used this operator in any way.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ordoshsen
  • 650
  • 3
  • 15

0 Answers0