mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Rewords additional code comments as complete sentences
This commit is contained in:
1 parent
36e43b7999
commit
871644b3c9
23 files changed
+171
-140
No files matched your search
@@ -26,7 +26,7 @@ public static class LibraryMapping
|
||||
LibraryType = domainEntity.LibraryType,
|
||||
UserId = domainEntity.UserId.Value,
|
||||
ContentLocations = [.. domainEntity.ContentLocations.Select(path => new LibraryContentLocationEntity() { Path = path.Path })],
|
||||
CoverImage = domainEntity.CoverImage,
|
||||
CoverImage = domainEntity.CoverImage.HasValue ? domainEntity.CoverImage.Value : null,
|
||||
IsEnabled = domainEntity.IsEnabled,
|
||||
IsLocked = domainEntity.IsLocked,
|
||||
CanDownloadMetadataFromWeb = domainEntity.CanDownloadMetadataFromWeb,
|
||||
@@ -46,8 +46,9 @@ public static class LibraryMapping
|
||||
})],
|
||||
CreatedOnUtc = domainEntity.CreatedOnUtc,
|
||||
CreatedBy = Guid.Empty,
|
||||
UpdatedOnUtc = domainEntity.UpdatedOnUtc.HasValue ? domainEntity.UpdatedOnUtc : null,
|
||||
UpdatedBy = Guid.Empty
|
||||
// The audit columns are owned by the auditing interceptor, which stamps only the rows that actually changed, so they are never mapped here.
|
||||
UpdatedOnUtc = null,
|
||||
UpdatedBy = null
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,36 @@ public static class ScheduledJobEntityMapping
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntity"/> to a copy that carries the provided status and execution timestamps.
|
||||
/// </summary>
|
||||
/// <param name="repositoryEntity">The repository entity to be converted.</param>
|
||||
/// <param name="status">The status to assign to the converted entity.</param>
|
||||
/// <param name="lastStartedOnUtc">The last start time to assign to the converted entity.</param>
|
||||
/// <param name="lastCompletedOnUtc">The last completion time to assign to the converted entity.</param>
|
||||
/// <returns>The converted repository entity.</returns>
|
||||
public static ScheduledJobEntity ToUpdatedRepositoryEntity(this ScheduledJobEntity repositoryEntity, ScheduledJobStatus status, DateTime? lastStartedOnUtc, DateTime? lastCompletedOnUtc)
|
||||
{
|
||||
return new ScheduledJobEntity
|
||||
{
|
||||
Id = repositoryEntity.Id,
|
||||
Name = repositoryEntity.Name,
|
||||
TaskType = repositoryEntity.TaskType,
|
||||
ScheduleType = repositoryEntity.ScheduleType,
|
||||
IntervalMinutes = repositoryEntity.IntervalMinutes,
|
||||
Hour = repositoryEntity.Hour,
|
||||
Minute = repositoryEntity.Minute,
|
||||
Status = status,
|
||||
OwnerUserId = repositoryEntity.OwnerUserId,
|
||||
LastStartedOnUtc = lastStartedOnUtc,
|
||||
LastCompletedOnUtc = lastCompletedOnUtc,
|
||||
CreatedOnUtc = repositoryEntity.CreatedOnUtc,
|
||||
CreatedBy = repositoryEntity.CreatedBy,
|
||||
UpdatedOnUtc = repositoryEntity.UpdatedOnUtc,
|
||||
UpdatedBy = repositoryEntity.UpdatedBy
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the schedule of <paramref name="repositoryEntity"/> from its flattened schedule properties.
|
||||
/// </summary>
|
||||
|
||||
+25
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Scheduling;
|
||||
using Lumina.Contracts.Responses.Scheduling;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Scheduling;
|
||||
@@ -26,4 +27,28 @@ public static class ScheduledJobExecutionEntityMapping
|
||||
repositoryEntity.CompletedOnUtc
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntity"/> to a copy that carries the provided completion time.
|
||||
/// </summary>
|
||||
/// <param name="repositoryEntity">The repository entity to be converted.</param>
|
||||
/// <param name="completedOnUtc">The completion time to assign to the converted entity.</param>
|
||||
/// <returns>The converted repository entity.</returns>
|
||||
public static ScheduledJobExecutionEntity ToUpdatedRepositoryEntity(this ScheduledJobExecutionEntity repositoryEntity, DateTime? completedOnUtc)
|
||||
{
|
||||
return new ScheduledJobExecutionEntity
|
||||
{
|
||||
Id = repositoryEntity.Id,
|
||||
ScheduledJobId = repositoryEntity.ScheduledJobId,
|
||||
TaskType = repositoryEntity.TaskType,
|
||||
IsCycleRun = repositoryEntity.IsCycleRun,
|
||||
WasCycleActive = repositoryEntity.WasCycleActive,
|
||||
StartedOnUtc = repositoryEntity.StartedOnUtc,
|
||||
CompletedOnUtc = completedOnUtc,
|
||||
CreatedOnUtc = repositoryEntity.CreatedOnUtc,
|
||||
CreatedBy = repositoryEntity.CreatedBy,
|
||||
UpdatedOnUtc = repositoryEntity.UpdatedOnUtc,
|
||||
UpdatedBy = repositoryEntity.UpdatedBy
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user