RingSoft.DbLookup.Controls.WPF.Properties Namespace
RingSoft.DbMaintenance Namespace

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.DbMaintenance
Assembly:  RingSoft.DbMaintenance (in RingSoft.DbMaintenance.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'
}

Inheritance Hierarchy


Object
  Attribute
    RingSoft.DbMaintenance..::..CanBeNullAttribute