CanBeNullAttribute Class
Indicates that the value of the marked element could be null sometimes,
so checking for null is required before its usage.
Namespace:
RingSoft.DataEntryControls.Engine.AnnotationsAssembly: RingSoft.DataEntryControls.Engine (in RingSoft.DataEntryControls.Engine.dll)
Syntax
[AttributeUsageAttribute] public sealed class CanBeNullAttribute : Attribute
<AttributeUsageAttribute> _ Public NotInheritable Class CanBeNullAttribute _ Inherits Attribute
[AttributeUsageAttribute] public ref class CanBeNullAttribute sealed : public Attribute
Examples
C#
[CanBeNull] object Test() => null; void UseTest() { var p = Test(); var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' }