23 lines
766 B
C#
23 lines
766 B
C#
using GozareshgirProgramManager.Application._Common.Models;
|
|
using GozareshgirProgramManager.Domain.FileManagementAgg.Entities;
|
|
|
|
namespace GozareshgirProgramManager.Application._Common.Extensions;
|
|
|
|
public static class FileExtensions
|
|
{
|
|
public static UploadedFileDto ToDto(this UploadedFile file)
|
|
{
|
|
return new UploadedFileDto()
|
|
{
|
|
Id = file.Id,
|
|
FileName = file.OriginalFileName,
|
|
FileUrl = file.StorageUrl ?? "",
|
|
FileSizeBytes = file.FileSizeBytes,
|
|
FileType = file.FileType.ToString(),
|
|
ThumbnailUrl = file.ThumbnailUrl,
|
|
ImageWidth = file.ImageWidth,
|
|
ImageHeight = file.ImageHeight,
|
|
DurationSeconds = file.DurationSeconds
|
|
};
|
|
}
|
|
} |