System.Diagnostics.CodeAnalysis.NotNullWhenAttribute sealed class NotNullWhenAttribute : Attribute Specifies that when a method returns ReturnValue, the parameter is not null. Documentation Code public NotNullWhenAttribute(bool returnValue) Initializes a new instance of the NotNullWhenAttribute class.