Skip to content

Commit

Permalink
Use DateTimeOffset? rather than DateTime?
Browse files Browse the repository at this point in the history
Signed-off-by: joshvanl <[email protected]>
  • Loading branch information
JoshVanL committed Oct 13, 2023
1 parent 9e4ada7 commit f3866e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Dapr.Actors/Communication/ActorStateResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal class ActorStateResponse<T>
/// </summary>
/// <param name="value">The response value.</param>
/// <param name="ttlExpireTime">The time to live expiration time.</param>
public ActorStateResponse(T value, DateTime? ttlExpireTime)
public ActorStateResponse(T value, DateTimeOffset? ttlExpireTime)
{
this.Value = value;
this.TTLExpireTime = ttlExpireTime;
Expand All @@ -45,6 +45,6 @@ public ActorStateResponse(T value, DateTime? ttlExpireTime)
/// <value>
/// The time to live expiration time.
/// </value>
public DateTime? TTLExpireTime { get; }
public DateTimeOffset? TTLExpireTime { get; }
}
}
4 changes: 2 additions & 2 deletions src/Dapr.Actors/Runtime/ActorStateChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed class ActorStateChange
/// <param name="value">The value associated with given actor state name.</param>
/// <param name="changeKind">The kind of state change for given actor state name.</param>
/// <param name="ttlExpireTime">The time to live for the state.</param>
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));

Expand Down Expand Up @@ -80,7 +80,7 @@ public ActorStateChange(string stateName, Type type, object value, StateChangeKi
/// <remarks>
/// If null, the state will not expire.
/// </remarks>
public DateTime? TTLExpireTime { get; }
public DateTimeOffset? TTLExpireTime { get; }

/// <summary>
/// Gets the time to live in seconds for the state.
Expand Down
6 changes: 3 additions & 3 deletions src/Dapr.Actors/Runtime/ActorStateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ private Dictionary<string, StateMetadata> 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;
Expand All @@ -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>(T value, StateChangeKind changeKind, DateTime? ttlExpireTime = null, int? ttlInSeconds = null)
public static StateMetadata Create<T>(T value, StateChangeKind changeKind, DateTimeOffset? ttlExpireTime = null, int? ttlInSeconds = null)
{
return new StateMetadata(value, typeof(T), changeKind, ttlExpireTime, ttlInSeconds);
}
Expand Down

0 comments on commit f3866e7

Please sign in to comment.