diff --git a/src/NRedisStack/TimeSeries/DataTypes/TimeStamp.cs b/src/NRedisStack/TimeSeries/DataTypes/TimeStamp.cs
index 5da7dc17..c7f67b4b 100644
--- a/src/NRedisStack/TimeSeries/DataTypes/TimeStamp.cs
+++ b/src/NRedisStack/TimeSeries/DataTypes/TimeStamp.cs
@@ -4,14 +4,14 @@
/// A class represents timestamp.
/// Value can be either primitive long, DateTime or one of the strings "-", "+", "*".
///
- public class TimeStamp
+ public readonly record struct TimeStamp
{
private static readonly string[] constants = { "-", "+", "*" };
///
/// TimeStamp value.
///
- public object Value { get; private set; }
+ public object Value { get; }
///
/// Build a TimeStamp from primitive long.
@@ -34,7 +34,7 @@ public TimeStamp(string timestamp)
{
if (Array.IndexOf(constants, timestamp) == -1)
{
- throw new NotSupportedException(string.Format("The string {0} cannot be used", timestamp));
+ throw new NotSupportedException($"The string {timestamp} cannot be used");
}
Value = timestamp;
}
@@ -78,14 +78,6 @@ public static implicit operator long(TimeStamp ts) =>
/// TimeStamp
public static implicit operator DateTime(TimeStamp timeStamp) => DateTimeOffset.FromUnixTimeMilliseconds(timeStamp).DateTime;
- ///
- /// Equality of TimeSeriesTuple objects
- ///
- /// Object to compare
- /// If two TimeStamp objects are equal
- public override bool Equals(object? obj) =>
- obj is TimeStamp stamp && EqualityComparer