Class BsonTimestamp
Represents a BSON timestamp value.
[Serializable]
public class BsonTimestamp : BsonValue, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonTimestamp>, IEquatable<BsonTimestamp>
- Inheritance
-
BsonTimestamp
- Implements
- Inherited Members
- Extension Methods
Constructors
BsonTimestamp(int, int)
Initializes a new instance of the BsonTimestamp class.
public BsonTimestamp(int timestamp, int increment)
Parameters
BsonTimestamp(long)
Initializes a new instance of the BsonTimestamp class.
public BsonTimestamp(long value)
Parameters
value
longThe combined timestamp/increment value.
Properties
BsonType
Gets the BsonType of this BsonValue.
public override BsonType BsonType { get; }
Property Value
Increment
Gets the increment.
public int Increment { get; }
Property Value
Timestamp
Gets the timestamp.
public int Timestamp { get; }
Property Value
Value
Gets the value of this BsonTimestamp.
public long Value { get; }
Property Value
Methods
CompareTo(BsonTimestamp)
Compares this BsonTimestamp to another BsonTimestamp.
public int CompareTo(BsonTimestamp other)
Parameters
other
BsonTimestampThe other BsonTimestamp.
Returns
- int
A 32-bit signed integer that indicates whether this BsonTimestamp is less than, equal to, or greather than the other.
CompareTo(BsonValue)
Compares the BsonTimestamp to another BsonValue.
public override int CompareTo(BsonValue other)
Parameters
other
BsonValueThe other BsonValue.
Returns
- int
A 32-bit signed integer that indicates whether this BsonTimestamp is less than, equal to, or greather than the other BsonValue.
Create(object)
Creates a new BsonTimestamp.
public static BsonTimestamp Create(object value)
Parameters
value
objectAn object to be mapped to a BsonTimestamp.
Returns
- BsonTimestamp
A BsonTimestamp or null.
Equals(BsonTimestamp)
Compares this BsonTimestamp to another BsonTimestamp.
public bool Equals(BsonTimestamp rhs)
Parameters
rhs
BsonTimestampThe other BsonTimestamp.
Returns
- bool
True if the two BsonTimestamp values are equal.
Equals(object)
Compares this BsonTimestamp to another object.
public override bool Equals(object obj)
Parameters
obj
objectThe other object.
Returns
- bool
True if the other object is a BsonTimestamp and equal to this one.
GetHashCode()
Gets the hash code.
public override int GetHashCode()
Returns
- int
The hash code.
ToString()
Returns a string representation of the value.
public override string ToString()
Returns
- string
A string representation of the value.
Operators
operator ==(BsonTimestamp, BsonTimestamp)
Compares two BsonTimestamp values.
public static bool operator ==(BsonTimestamp lhs, BsonTimestamp rhs)
Parameters
lhs
BsonTimestampThe first BsonTimestamp.
rhs
BsonTimestampThe other BsonTimestamp.
Returns
- bool
True if the two BsonTimestamp values are equal according to ==.
operator !=(BsonTimestamp, BsonTimestamp)
Compares two BsonTimestamp values.
public static bool operator !=(BsonTimestamp lhs, BsonTimestamp rhs)
Parameters
lhs
BsonTimestampThe first BsonTimestamp.
rhs
BsonTimestampThe other BsonTimestamp.
Returns
- bool
True if the two BsonTimestamp values are not equal according to ==.