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.DbLookup.Controls.WPF.PropertiesAssembly: RingSoft.DbLookup.Controls.WPF (in RingSoft.DbLookup.Controls.WPF.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' }