Replace DateTime.UtcNow with DateTime.Now for timestamps
Switched all audit and creation timestamps from UTC to local time by replacing DateTime.UtcNow with DateTime.Now across the codebase. This affects audit fields, object creation, and default values for date/time properties.
This commit is contained in:
@@ -13,12 +13,12 @@ public static class AutoMapperAuditingExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static IMappingExpression<TSource, TDestination> MapAddedWhen<TSource, TDestination>(this IMappingExpression<TSource, TDestination> expression)
|
public static IMappingExpression<TSource, TDestination> MapAddedWhen<TSource, TDestination>(this IMappingExpression<TSource, TDestination> expression)
|
||||||
where TDestination : IHasAddedWhen
|
where TDestination : IHasAddedWhen
|
||||||
=> expression.ForMember(dest => dest.AddedWhen, opt => opt.MapFrom(_ => DateTime.UtcNow));
|
=> expression.ForMember(dest => dest.AddedWhen, opt => opt.MapFrom(_ => DateTime.Now));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Maps <see cref="IHasChangedWhen.ChangedWhen"/> to the current UTC time.
|
/// Maps <see cref="IHasChangedWhen.ChangedWhen"/> to the current UTC time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IMappingExpression<TSource, TDestination> MapChangedWhen<TSource, TDestination>(this IMappingExpression<TSource, TDestination> expression)
|
public static IMappingExpression<TSource, TDestination> MapChangedWhen<TSource, TDestination>(this IMappingExpression<TSource, TDestination> expression)
|
||||||
where TDestination : IHasChangedWhen
|
where TDestination : IHasChangedWhen
|
||||||
=> expression.ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(_ => DateTime.UtcNow));
|
=> expression.ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(_ => DateTime.Now));
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
|
|||||||
EmailAddress = notification.EmailAddress,
|
EmailAddress = notification.EmailAddress,
|
||||||
EmailBody = temp.Body,
|
EmailBody = temp.Body,
|
||||||
EmailSubj = temp.Subject,
|
EmailSubj = temp.Subject,
|
||||||
AddedWhen = DateTime.UtcNow,
|
AddedWhen = DateTime.Now,
|
||||||
AddedWho = DispatcherParams.AddedWho,
|
AddedWho = DispatcherParams.AddedWho,
|
||||||
SendingProfile = DispatcherParams.SendingProfile,
|
SendingProfile = DispatcherParams.SendingProfile,
|
||||||
ReminderTypeId = DispatcherParams.ReminderTypeId,
|
ReminderTypeId = DispatcherParams.ReminderTypeId,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<UpdateDocStatusCommand, DocumentStatus>()
|
CreateMap<UpdateDocStatusCommand, DocumentStatus>()
|
||||||
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.Receiver, opt => opt.Ignore())
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.StatusChangedWhen, opt => opt.MapFrom(src => DateTime.UtcNow))
|
.ForMember(dest => dest.StatusChangedWhen, opt => opt.MapFrom(src => DateTime.Now))
|
||||||
.MapChangedWhen();
|
.MapChangedWhen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<History
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime AddedWhen { get; } = DateTime.UtcNow;
|
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public static class Extensions
|
|||||||
Title = faker.Lorem.Paragraph(faker.Random.Number(1, 2)),
|
Title = faker.Lorem.Paragraph(faker.Random.Number(1, 2)),
|
||||||
Message = faker.Lorem.Paragraph(faker.Random.Number(2, 5)),
|
Message = faker.Lorem.Paragraph(faker.Random.Number(2, 5)),
|
||||||
TfaEnabled = tfaEnabled,
|
TfaEnabled = tfaEnabled,
|
||||||
AddedWhen = DateTime.UtcNow,
|
AddedWhen = DateTime.Now,
|
||||||
CertificationType = (int)CertificationType.AdvancedElectronicSignature,
|
CertificationType = (int)CertificationType.AdvancedElectronicSignature,
|
||||||
UseAccessCode = false,
|
UseAccessCode = false,
|
||||||
ContractType = (int)ContractType.Contract,
|
ContractType = (int)ContractType.Contract,
|
||||||
@@ -273,9 +273,9 @@ public static class Extensions
|
|||||||
EnvelopeId = envelopeId,
|
EnvelopeId = envelopeId,
|
||||||
ReceiverId = receiverId,
|
ReceiverId = receiverId,
|
||||||
Status = ReceiverStatus.Unsigned,
|
Status = ReceiverStatus.Unsigned,
|
||||||
AddedWhen = DateTime.UtcNow,
|
AddedWhen = DateTime.Now,
|
||||||
AccessCode = faker.Random.Number(1000, 9999).ToString(),
|
AccessCode = faker.Random.Number(1000, 9999).ToString(),
|
||||||
ChangedWhen = DateTime.UtcNow,
|
ChangedWhen = DateTime.Now,
|
||||||
CompanyName = faker.Company.CompanyName(),
|
CompanyName = faker.Company.CompanyName(),
|
||||||
JobTitle = faker.Name.JobTitle(),
|
JobTitle = faker.Name.JobTitle(),
|
||||||
Name = faker.Name.FullName(),
|
Name = faker.Name.FullName(),
|
||||||
|
|||||||
Reference in New Issue
Block a user