Feature Request:
Add Null Helper Attributes to IsNullOrEmpty or similar methods.
With CMS 12 and .NET 6 we are able to build projects that are defined as using nullable reference types. This is also the default for any new .NET 6.0 project. With this in mind, we can decorate input and output parameters on methods that allow the code analysis engine to understand if something is potentially null and encouraging null checking/handling within custom code.
e.g.
public static bool IsNullOrEmpty(this ContentReference contentReference)
{
return ContentReference.IsNullOrEmpty(contentReference);
}
Could be declared as
public static bool IsNullOrEmpty([NotNullWhen(false)] this ContentReference? contentReference)
{
return ContentReference.IsNullOrEmpty(contentReference);
}