Class Patch<T>
Represents a value set in a patch, so a patch can tell a property set to null from one left out, which a null Patch<T> stands for.
public class Patch<T>
Type Parameters
TThe type of the value.
- Inheritance
-
Patch<T>
- Inherited Members
Constructors
Patch(T)
Represents a value set in a patch, so a patch can tell a property set to null from one left out, which a null Patch<T> stands for.
public Patch(T value)
Parameters
valueTThe value.
Properties
Value
Gets the value.
public T Value { get; }
Property Value
- T
Methods
Equals(object?)
Determines whether the patch equals an object: another patch by its value, anything else with the value itself.
public override bool Equals(object? obj)
Parameters
objobjectThe object.
Returns
GetHashCode()
Returns the value's hash code, or an empty string's for null.
public override int GetHashCode()
Returns
- int
The hash code.
ToString()
Returns the value's text, or empty for null.
public override string ToString()
Returns
- string
The text.
Operators
implicit operator T(Patch<T>)
Unwraps a patch's value.
public static implicit operator T(Patch<T> value)
Parameters
valuePatch<T>The patch.
Returns
- T
The value.
Exceptions
- NullReferenceException
The patch is null: the value was not set.
implicit operator Patch<T>(T)
Wraps a value in a patch.
public static implicit operator Patch<T>(T value)
Parameters
valueTThe value.
Returns
- Patch<T>
The patch.