Class CanBeNullAttribute
Indicates that the value of the marked element could be null
sometimes,
so the check for null
is necessary before its usage.
Inheritance
System.Object
CanBeNullAttribute
Namespace: MAT.Atlas.Api.Core.Presentation
Assembly: MAT.Atlas.Api.Core.dll
Syntax
public sealed class CanBeNullAttribute : Attribute
Examples
[CanBeNull] object Test() => null;
void UseTest() {
var p = Test();
var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
}
Constructors
CanBeNullAttribute()
Declaration
public CanBeNullAttribute()