mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-03 20:12: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)
|
protected CommandBase(Guid aggregateId)
|
||||||
{
|
{
|
||||||
MessageType = GetType().Name;
|
MessageType = GetType().Name;
|
||||||
Timestamp = DateTime.Now;
|
Timestamp = DateTime.UtcNow;
|
||||||
AggregateId = aggregateId;
|
AggregateId = aggregateId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public sealed class LoginUserCommandHandler : CommandHandlerBase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
user.SetActive();
|
user.SetActive();
|
||||||
user.SetLastLoggedinDate(DateTimeOffset.Now);
|
user.SetLastLoggedinDate(DateTimeOffset.UtcNow);
|
||||||
|
|
||||||
if (!await CommitAsync())
|
if (!await CommitAsync())
|
||||||
{
|
{
|
||||||
@ -103,7 +103,7 @@ public sealed class LoginUserCommandHandler : CommandHandlerBase,
|
|||||||
tokenSettings.Issuer,
|
tokenSettings.Issuer,
|
||||||
tokenSettings.Audience,
|
tokenSettings.Audience,
|
||||||
claims,
|
claims,
|
||||||
expires: DateTime.Now.AddMinutes(_expiryDurationMinutes),
|
expires: DateTime.UtcNow.AddMinutes(_expiryDurationMinutes),
|
||||||
signingCredentials: credentials);
|
signingCredentials: credentials);
|
||||||
|
|
||||||
return new JwtSecurityTokenHandler().WriteToken(tokenDescriptor);
|
return new JwtSecurityTokenHandler().WriteToken(tokenDescriptor);
|
||||||
|
@ -9,11 +9,11 @@ public abstract class DomainEvent : Message, INotification
|
|||||||
|
|
||||||
protected DomainEvent(Guid aggregateId) : base(aggregateId)
|
protected DomainEvent(Guid aggregateId) : base(aggregateId)
|
||||||
{
|
{
|
||||||
Timestamp = DateTime.Now;
|
Timestamp = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DomainEvent(Guid aggregateId, string? messageType) : base(aggregateId, messageType)
|
protected DomainEvent(Guid aggregateId, string? messageType) : base(aggregateId, messageType)
|
||||||
{
|
{
|
||||||
Timestamp = DateTime.Now;
|
Timestamp = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user