Skip to content

Instantly share code, notes, and snippets.

@roughiain
Created January 19, 2023 14:24
Show Gist options
  • Save roughiain/836ebee4a91b40d2152f177edf73cd61 to your computer and use it in GitHub Desktop.
Save roughiain/836ebee4a91b40d2152f177edf73cd61 to your computer and use it in GitHub Desktop.
NotNullWhenTrueAttribute for custom try parse
    public bool TryParseDirectoryPath(string pathtoValidate, [NotNullWhen(true)] out string? validDirectoryPath)

reference link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment