Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Class UnixMillisecondsConverter

Newtonsoft.Json.JsonConverter which serializes a DateTime property as milliseconds since the Unix epoch. This is an alternative to the default ISO8601 format.

Inheritance
object
JsonConverter
UnixMillisecondsConverter
Inherited Members
JsonConverter.CanRead
JsonConverter.CanWrite
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Couchbase.Core.IO.Serializers
Assembly: Couchbase.NetClient.dll
Syntax
public class UnixMillisecondsConverter : JsonConverter
Remarks

Apply to a property using Newtonsoft.Json.JsonConverterAttribute.

Constructors

View Source

UnixMillisecondsConverter()

Declaration
public UnixMillisecondsConverter()

Methods

View Source

CanConvert(Type)

Determines whether this instance can convert the specified object type.

Declaration
public override bool CanConvert(Type objectType)
Parameters
Type Name Description
Type objectType

Type of the object.

Returns
Type Description
bool

true if this instance can convert the specified object type; otherwise, false.

Overrides
JsonConverter.CanConvert(Type)
View Source

ReadJson(JsonReader, Type, object, JsonSerializer)

Reads the JSON representation of the object.

Declaration
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Parameters
Type Name Description
JsonReader reader

The Newtonsoft.Json.JsonReader to read from.

Type objectType

Type of the object.

object existingValue

The existing value of object being read.

JsonSerializer serializer

The calling serializer.

Returns
Type Description
object

The object value.

Overrides
JsonConverter.ReadJson(JsonReader, Type, object, JsonSerializer)
View Source

WriteJson(JsonWriter, object, JsonSerializer)

Writes the JSON representation of the object.

Declaration
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Parameters
Type Name Description
JsonWriter writer

The Newtonsoft.Json.JsonWriter to write to.

object value

The value.

JsonSerializer serializer

The calling serializer.

Overrides
JsonConverter.WriteJson(JsonWriter, object, JsonSerializer)
  • View Source
In this article
Back to top Copyright © 2020 Couchbase, Inc. All rights reserved.