diff --git a/src/Dapr.Actors/Communication/ActorStateResponse.cs b/src/Dapr.Actors/Communication/ActorStateResponse.cs index 1a990ce46..e60878b6a 100644 --- a/src/Dapr.Actors/Communication/ActorStateResponse.cs +++ b/src/Dapr.Actors/Communication/ActorStateResponse.cs @@ -25,7 +25,7 @@ internal class ActorStateResponse /// /// The response value. /// The time to live expiration time. - public ActorStateResponse(T value, DateTime? ttlExpireTime) + public ActorStateResponse(T value, DateTimeOffset? ttlExpireTime) { this.Value = value; this.TTLExpireTime = ttlExpireTime; @@ -45,6 +45,6 @@ public ActorStateResponse(T value, DateTime? ttlExpireTime) /// /// The time to live expiration time. /// - public DateTime? TTLExpireTime { get; } + public DateTimeOffset? TTLExpireTime { get; } } } diff --git a/src/Dapr.Actors/Runtime/ActorStateChange.cs b/src/Dapr.Actors/Runtime/ActorStateChange.cs index 18c7eaac1..32a3ca7fe 100644 --- a/src/Dapr.Actors/Runtime/ActorStateChange.cs +++ b/src/Dapr.Actors/Runtime/ActorStateChange.cs @@ -28,7 +28,7 @@ public sealed class ActorStateChange /// The value associated with given actor state name. /// The kind of state change for given actor state name. /// The time to live for the state. - public ActorStateChange(string stateName, Type type, object value, StateChangeKind changeKind, DateTime? ttlExpireTime) + public ActorStateChange(string stateName, Type type, object value, StateChangeKind changeKind, DateTimeOffset? ttlExpireTime) { ArgumentVerifier.ThrowIfNull(stateName, nameof(stateName)); @@ -80,7 +80,7 @@ public ActorStateChange(string stateName, Type type, object value, StateChangeKi /// /// If null, the state will not expire. /// - public DateTime? TTLExpireTime { get; } + public DateTimeOffset? TTLExpireTime { get; } /// /// Gets the time to live in seconds for the state. diff --git a/src/Dapr.Actors/Runtime/ActorStateManager.cs b/src/Dapr.Actors/Runtime/ActorStateManager.cs index aa5b62376..f6c561566 100644 --- a/src/Dapr.Actors/Runtime/ActorStateManager.cs +++ b/src/Dapr.Actors/Runtime/ActorStateManager.cs @@ -529,7 +529,7 @@ private Dictionary GetContextualStateTracker() private sealed class StateMetadata { - private StateMetadata(object value, Type type, StateChangeKind changeKind, DateTime? ttlExpireTime = null, int? ttlInSeconds = null) + private StateMetadata(object value, Type type, StateChangeKind changeKind, DateTimeOffset? ttlExpireTime = null, int? ttlInSeconds = null) { this.Value = value; this.Type = type; @@ -551,9 +551,9 @@ private StateMetadata(object value, Type type, StateChangeKind changeKind, DateT public Type Type { get; } - public DateTime? TTLExpireTime { get; set; } + public DateTimeOffset? TTLExpireTime { get; set; } - public static StateMetadata Create(T value, StateChangeKind changeKind, DateTime? ttlExpireTime = null, int? ttlInSeconds = null) + public static StateMetadata Create(T value, StateChangeKind changeKind, DateTimeOffset? ttlExpireTime = null, int? ttlInSeconds = null) { return new StateMetadata(value, typeof(T), changeKind, ttlExpireTime, ttlInSeconds); }