Struct NullObject
- Namespace
- Cobilas
- Assembly
- Cobilas.Core.dll
This class represents a null object.
public readonly struct NullObject : INullObject
- Implements
- Inherited Members
- Extension Methods
Properties
Null
Obtain a null representation of the object
public static NullObject Null { get; }
Property Value
- NullObject
Retorna uma representação nulo do objeto
Methods
GetNullObject(Type?, bool)
Obtain a null representation of the object that inherits the INullObject interface.
public static object GetNullObject(Type? target, bool ignoreINullObject = false)
Parameters
targetTypeThe type that will be used to obtain a null representation.
ignoreINullObjectboolIt causes the method to return objects that do not inherit INullObject.
Returns
- object
Returns a null representation of the object that inherits the INullObject interface.
Exceptions
- InvalidCastException
It occurs when the
targettype does not inherit the INullObject interface.- ArgumentNullException
It occurs when the
targetparameter is null.
GetNullObject<T>(bool)
Obtain a null representation of the object that inherits the INullObject interface.
public static T GetNullObject<T>(bool ignoreINullObject = false)
Parameters
ignoreINullObjectboolIt causes the method to return objects that do not inherit INullObject.
Returns
- T
Returns a null representation of the object that inherits the INullObject interface.
Type Parameters
TThe type that will be used to obtain a null representation.
Exceptions
- InvalidCastException
It occurs when the
targettype does not inherit the INullObject interface.- ArgumentNullException
It occurs when the
targetparameter is null.