Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1182,4 +1182,4 @@
}
},
"NestedTypes": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos
{
using System;
using System.Collections.Generic;
using System.Net;
using Microsoft.Azure.Cosmos.Resource.FullFidelity;
using Microsoft.Azure.Documents;
using Newtonsoft.Json;
Expand All @@ -28,12 +29,26 @@ class ChangeFeedMetadata
/// </summary>
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
public DateTime? ConflictResolutionTimestamp => this.ConflictResolutionTimestampInSeconds.HasValue ? UnixEpoch.AddSeconds(this.ConflictResolutionTimestampInSeconds.Value) : null;
public DateTime ConflictResolutionTimestamp => UnixEpoch.AddSeconds(this.ConflictResolutionTimestampInSeconds);

private double conflictResolutionTimestampInSeconds;

[System.Text.Json.Serialization.JsonInclude]
[System.Text.Json.Serialization.JsonPropertyName(ChangeFeedMetadataFields.ConflictResolutionTimestamp)]
[JsonProperty(PropertyName = ChangeFeedMetadataFields.ConflictResolutionTimestamp)]
internal double? ConflictResolutionTimestampInSeconds { get; set; }
[JsonProperty(PropertyName = ChangeFeedMetadataFields.ConflictResolutionTimestamp, Required = Required.Always)]
internal double ConflictResolutionTimestampInSeconds
{
get => this.conflictResolutionTimestampInSeconds;
set
{
if (value == 0)
{
throw new System.Text.Json.JsonException(
$"{ChangeFeedMetadataFields.ConflictResolutionTimestamp} cannot be zero.");
}
this.conflictResolutionTimestampInSeconds = value;
}
}

/// <summary>
/// The current change's logical sequence number.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,18 @@
],
"MethodInfo": "System.Collections.Generic.Dictionary`2[System.String,System.Object] PartitionKey;CanRead:True;CanWrite:True;System.Collections.Generic.Dictionary`2[System.String,System.Object] get_PartitionKey();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.DateTime] ConflictResolutionTimestamp[System.Text.Json.Serialization.JsonIgnoreAttribute()]-[Newtonsoft.Json.JsonIgnoreAttribute()]": {
"System.DateTime ConflictResolutionTimestamp[System.Text.Json.Serialization.JsonIgnoreAttribute()]-[Newtonsoft.Json.JsonIgnoreAttribute()]": {
"Type": "Property",
"Attributes": [
"JsonIgnoreAttribute",
"JsonIgnoreAttribute"
],
"MethodInfo": "System.Nullable`1[System.DateTime] ConflictResolutionTimestamp;CanRead:True;CanWrite:False;System.Nullable`1[System.DateTime] get_ConflictResolutionTimestamp();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
"MethodInfo": "System.DateTime ConflictResolutionTimestamp;CanRead:True;CanWrite:False;System.DateTime get_ConflictResolutionTimestamp();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.Nullable`1[System.DateTime] get_ConflictResolutionTimestamp()": {
"System.DateTime get_ConflictResolutionTimestamp()": {
"Type": "Method",
"Attributes": [],
"MethodInfo": "System.Nullable`1[System.DateTime] get_ConflictResolutionTimestamp();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
"MethodInfo": "System.DateTime get_ConflictResolutionTimestamp();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.String get_Id()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
Expand Down