Class MonthsValue
Adds a whole number of calendar months to a date, clamping to the last day of the target month.
[MessagePackObject(false)]
public sealed class MonthsValue : Value, IEquatable<Value>
- Inheritance
-
MonthsValue
- Implements
- Inherited Members
Constructors
MonthsValue(Value, int, AttributeType)
Adds a whole number of calendar months to a date, clamping to the last day of the target month.
public MonthsValue(Value operand, int amount, AttributeType type)
Parameters
operandValueamountinttypeAttributeType
Fields
Amount
[Key(1)]
public readonly int Amount
Field Value
Operand
[Key(0)]
public readonly Value Operand
Field Value
Type
Type of the operand - Date, DateTime or Instant. Instants are stored in UTC, so their calendar date is taken in the client's timezone.
[Key(2)]
public readonly AttributeType Type
Field Value
Properties
IsLiteral
Whether the value is self-paranthesing.
[IgnoreMember]
public override bool IsLiteral { get; }
Property Value
IsNullable
Whether the value can be NULL at runtime.
[IgnoreMember]
public override bool IsNullable { get; }
Property Value
Joins
Joins required to reach this value.
[IgnoreMember]
public override IEnumerable<Join> Joins { get; }
Property Value
Methods
DaysToAdd(DateOnly, int)
Calendar days spanned by moving date by months months, clamping to the last day of the target month like AddMonths(int).
public static int DaysToAdd(DateOnly date, int months)
Parameters
Returns
Equals(Value?)
Indicates whether the current object is equal to another object of the same type.
public override bool Equals(Value? obj)
Parameters
objValue
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Update(Value, int, AttributeType)
public MonthsValue Update(Value operand, int amount, AttributeType type)
Parameters
operandValueamountinttypeAttributeType
Returns
WithSource(Table, Table)
public override Value WithSource(Table oldSource, Table newSource)