mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-04 04:22:56 +00:00
fix: Use utc now instead of now
This commit is contained in:
parent
f5dbecda7b
commit
9c9627dd08
@ -14,7 +14,7 @@ public abstract class CommandBase : IRequest
|
||||
protected CommandBase(Guid aggregateId)
|
||||
{
|
||||
MessageType = GetType().Name;
|
||||
Timestamp = DateTime.Now;
|
||||
Timestamp = DateTime.UtcNow;
|
||||
AggregateId = aggregateId;
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ public sealed class LoginUserCommandHandler : CommandHandlerBase,
|
||||
}
|
||||
|
||||
user.SetActive();
|
||||
user.SetLastLoggedinDate(DateTimeOffset.Now);
|
||||
user.SetLastLoggedinDate(DateTimeOffset.UtcNow);
|
||||
|
||||
if (!await CommitAsync())
|
||||
{
|
||||
@ -103,7 +103,7 @@ public sealed class LoginUserCommandHandler : CommandHandlerBase,
|
||||
tokenSettings.Issuer,
|
||||
tokenSettings.Audience,
|
||||
claims,
|
||||
expires: DateTime.Now.AddMinutes(_expiryDurationMinutes),
|
||||
expires: DateTime.UtcNow.AddMinutes(_expiryDurationMinutes),
|
||||
signingCredentials: credentials);
|
||||
|
||||
return new JwtSecurityTokenHandler().WriteToken(tokenDescriptor);
|
||||
|
@ -9,11 +9,11 @@ public abstract class DomainEvent : Message, INotification
|
||||
|
||||
protected DomainEvent(Guid aggregateId) : base(aggregateId)
|
||||
{
|
||||
Timestamp = DateTime.Now;
|
||||
Timestamp = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
protected DomainEvent(Guid aggregateId, string? messageType) : base(aggregateId, messageType)
|
||||
{
|
||||
Timestamp = DateTime.Now;
|
||||
Timestamp = DateTime.UtcNow;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user