MongoDB.Bson.IO.BsonWriter.WriteTimestamp C# (CSharp) Method

WriteTimestamp() public abstract method

Writes a BSON timestamp to the writer.
public abstract WriteTimestamp ( long value ) : void
value long The combined timestamp/increment value.
return void
        public abstract void WriteTimestamp(long value);

Same methods

BsonWriter::WriteTimestamp ( string name, long value ) : void

Usage Example

 /// <summary>
 /// Serializes an object to a BsonWriter.
 /// </summary>
 /// <param name="bsonWriter">The BsonWriter.</param>
 /// <param name="nominalType">The nominal type.</param>
 /// <param name="value">The object.</param>
 /// <param name="options">The serialization options.</param>
 public override void Serialize(
     BsonWriter bsonWriter,
     Type nominalType,
     object value,
     IBsonSerializationOptions options
 ) {
     if (value == null) {
         bsonWriter.WriteNull();
     } else {
         var timestamp = (BsonTimestamp) value;
         bsonWriter.WriteTimestamp(timestamp.Value);
     }
 }
All Usage Examples Of MongoDB.Bson.IO.BsonWriter::WriteTimestamp