Class DateTimeOffsetSerializer
A serializer for the GraphBinary types Date and Timestamp. Both are represented as DateTimeOffset in .NET.
Implements
Inherited Members
Namespace: Gremlin.Net.Structure.IO.GraphBinary.Types
Assembly: Gremlin.Net.dll
Syntax
public class DateTimeOffsetSerializer : SimpleTypeSerializer<DateTimeOffset>, ITypeSerializer
Fields
DateSerializer
A serializer for the GraphBinary type Date, represented as DateTimeOffset in .NET.
Declaration
public static readonly DateTimeOffsetSerializer DateSerializer
Field Value
| Type | Description |
|---|---|
| DateTimeOffsetSerializer |
TimestampSerializer
A serializer for the GraphBinary type Timestamp, represented as DateTimeOffset in .NET.
Declaration
public static readonly DateTimeOffsetSerializer TimestampSerializer
Field Value
| Type | Description |
|---|---|
| DateTimeOffsetSerializer |
Methods
ReadValueAsync(Stream, GraphBinaryReader, CancellationToken)
Reads a non-nullable value according to the type format.
Declaration
protected override Task<DateTimeOffset> ReadValueAsync(Stream stream, GraphBinaryReader reader, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The GraphBinary data to parse. |
| GraphBinaryReader | reader | |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task<DateTimeOffset> | The read value. |
Overrides
WriteValueAsync(DateTimeOffset, Stream, GraphBinaryWriter, CancellationToken)
Writes a non-nullable value into a stream.
Declaration
protected override Task WriteValueAsync(DateTimeOffset value, Stream stream, GraphBinaryWriter writer, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTimeOffset | value | The value to write. |
| Stream | stream | The stream to write to. |
| GraphBinaryWriter | writer | |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous write operation. |