"Null-Correctness Assisting Attributes: NotNullWhen"

// NotNullWhen indicates that a parameter is not null when the return value of a method is true or false.

// The annotation here indicates that when 'TryParseUser()' returns true, 'u' will always have a value assigned.

public bool TryParseUser(string userIdentifier, [NotNullWhen(true)] out User u) { /* ... */ }


Code snippet taken from "Complete C# Quick Reference - C# 8".