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 ToDtos(IEnumerable comments) => comments.Select(ToDto).ToList(); } }