Files
T120B165/T120B165-ImgBoard/Dtos/Post/PostDto.cs
2025-10-04 13:27:29 +03:00

26 lines
580 B
C#

using File = T120B165_ImgBoard.Models.File;
namespace T120B165_ImgBoard.Dtos.Post;
public record PostDto(
int Id,
string Title,
string Description,
SlimUserDto Author,
List<Models.Tag> Tags,
string? FileUrl
)
{
public static PostDto FromPost(Models.Post post, string? fileUrl)
{
return new PostDto(
Id: post.Id,
Title: post.Title,
Description: post.Description,
Author: SlimUserDto.FromUser(post.Author),
Tags: post.Tags,
FileUrl: fileUrl
);
}
}