Правка типов дат в методах внутри FileRepository и TrajectoryEditableRepository

This commit is contained in:
Olga Nemt 2024-03-25 10:10:40 +05:00
parent b5f71b9816
commit 09be968972
3 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ namespace AsbCloudApp.Requests
/// </summary>
public class SubsystemRequest: RequestBase, IValidatableObject
{
private static readonly DateTime validationMinDate = new DateTime(2020,01,01,0,0,0,DateTimeKind.Utc);
private static readonly DateTimeOffset validationMinDate = new DateTimeOffset(2020,01,01,0,0,0, TimeSpan.Zero);
/// <summary>
/// идентификатор скважины

View File

@ -184,7 +184,7 @@ namespace AsbCloudInfrastructure.Repository
var newFileMark = fileMarkDto.Adapt<FileMark>();
newFileMark.Id = default;
newFileMark.DateCreated = DateTime.UtcNow;
newFileMark.DateCreated = DateTimeOffset.UtcNow;
newFileMark.IdUser = idUser;
newFileMark.User = null!;
@ -244,7 +244,7 @@ namespace AsbCloudInfrastructure.Repository
IdAuthor = newItem.IdAuthor,
IdCategory = newItem.IdCategory,
Name = newItem.Name,
UploadDate = DateTime.UtcNow,
UploadDate = DateTimeOffset.UtcNow,
IsDeleted = false,
Size = newItem.Size,
};

View File

@ -115,7 +115,7 @@ namespace AsbCloudInfrastructure.Repository
private static TEntity Convert(Tdto dto, double offsetHours)
{
var entity = dto.Adapt<TEntity>();
entity.UpdateDate = DateTime.Now.ToUtcDateTimeOffset(offsetHours);
entity.UpdateDate = DateTimeOffset.Now.ToOffset(TimeSpan.FromHours(offsetHours));
return entity;
}
}