Implementing a Null-Checking-Method

How can I implement a method that tells Resharper that a value has already been tested for null?
 Snippet



0
4 comments

Use the ContractAnnotation attribute:

[ContractAnnotation("null => true")]
public static bool IsNullOrEmpty<TEnumerable>([CanBeNull] this IEnumerable<TEnumerable> enumerable)
1
Avatar
Permanently deleted user

Thank you :-)

0

Is there any way to do this with Null Checking Patterns so that we are not dependent on annotations?

0

Please sign in to leave a comment.