Click or drag to resize

CanBeNullAttribute Class

Indicates that the value of the marked element could be null sometimes, so the check for null is necessary before its usage
Inheritance Hierarchy
SystemObject
  SystemAttribute
    Ozeki.CommonCanBeNullAttribute

Namespace: Ozeki.Common
Assembly: OzekiSDK (in OzekiSDK.dll) Version: 10.4.13.0
Syntax
public sealed class CanBeNullAttribute : Attribute

The CanBeNullAttribute type exposes the following members.

Constructors
 NameDescription
Public methodCanBeNullAttributeInitializes a new instance of the CanBeNullAttribute class
Top
Example
C#
[CanBeNull] public object Test() { return null; }
public void UseTest() {
  var p = Test();
  var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
}
See Also