mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 09:33:13 +00:00
23 lines
728 B
C#
23 lines
728 B
C#
using Data.SeaHavenIndustries;
|
|
using SeaHaven.Services.DTOs;
|
|
|
|
namespace SeaHaven.Services.Helpers
|
|
{
|
|
public static class WorkOrderCommentProjection
|
|
{
|
|
public static WorkOrderCommentDto ToDto(Comments comment)
|
|
{
|
|
return new WorkOrderCommentDto
|
|
{
|
|
Id = comment.Id,
|
|
AuthorId = comment.UserId,
|
|
Text = comment.Commenttext ?? "",
|
|
Time = (comment.CreatedDate ?? DateTime.UtcNow).ToUniversalTime().ToString("o"),
|
|
Documents = comment.Documents
|
|
};
|
|
}
|
|
|
|
public static List<WorkOrderCommentDto> ToDtos(IEnumerable<Comments> comments)
|
|
=> comments.Select(ToDto).ToList();
|
|
}
|
|
}
|