The c# null-conditional operator and extension methods

added by Alex van Beek
5/2/2016 9:24:23 AM

631 Views

Using the null-conditional operator can break existing code calling extension methods. In this post I'll explain how this can happen. Since C# 6 we can use the null-conditional operator in our code to prevent NullReferenceExceptions like this: So no NullReferenceException is thrown on line 4 and the result of the whole expression becomes NULL.


0 comments