What does exclamation mark mean before invoking a method in C# 8.0? [duplicate]

This would be the null forgiving operator.
It tells the compiler “this isn’t null, trust me”, so it does not issue a warning for a possible null reference.

In this particular case it tells the compiler that Entity isn’t null.

Leave a Comment