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
target
TypeThe type that will be used to obtain a null representation.
ignoreINullObject
boolIt 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
target
type does not inherit the INullObject interface.- ArgumentNullException
It occurs when the
target
parameter 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
ignoreINullObject
boolIt 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
T
The type that will be used to obtain a null representation.
Exceptions
- InvalidCastException
It occurs when the
target
type does not inherit the INullObject interface.- ArgumentNullException
It occurs when the
target
parameter is null.