Custom Null Checking Patterns - How to add without using Attributes?

Answered

Hello!

I see that the common solution for Custom Null-Checking Methods is this

 

 

 

But I also see here that custom null checking patterns can also be created:

 

My question is:

How do I implement a custom null checking method pattern without using attribute contract annotations?

 

Example Method:

 

 

I would like to accomplish this without using [CanBeNull] and [ContractAnnotation("value:null => false;value:notnull => true")] annotiations. 

Is it possible?

0
2 comments

I suspect you'll still need an attribute - see my answer on your other thread.

0

Thank you! I will take a look at this, I appreciate it

0

Please sign in to leave a comment.