40 lines
1.6 KiB
C#
40 lines
1.6 KiB
C#
namespace Netina.Domain.Entities.Blogs;
|
|
|
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = [typeof(AdaptIgnoreAttribute)], MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = [typeof(AdaptIgnoreAttribute)], MapType = MapType.Map | MapType.MapToTarget)]
|
|
[AdaptTo("[name]SDto", IgnoreAttributes = [typeof(AdaptIgnoreAttribute)], MapType = MapType.Projection)]
|
|
[GenerateMapper]
|
|
|
|
public partial class Blog : ApiEntity
|
|
{
|
|
public Blog()
|
|
{
|
|
|
|
}
|
|
public Blog(string title,string slug,string content,string tags, int readingTime,string summery, bool isSuggested, Guid categoryId,Guid authorId)
|
|
{
|
|
Title = title;
|
|
Content = content;
|
|
Tags = tags;
|
|
ReadingTime = readingTime;
|
|
Summery = summery;
|
|
IsSuggested = isSuggested;
|
|
CategoryId = categoryId;
|
|
AuthorId = authorId;
|
|
Slug = slug;
|
|
}
|
|
public string Title { get; internal set; } = string.Empty;
|
|
public string Content { get; set; } = string.Empty;
|
|
public string Slug { get; internal set; } = string.Empty;
|
|
public string Tags { get; internal set; } = string.Empty;
|
|
public int ReadingTime { get; internal set; }
|
|
public string Summery { get; internal set; } = string.Empty;
|
|
public bool IsSuggested { get; internal set; }
|
|
public Guid CategoryId { get; internal set; }
|
|
public BlogCategory? Category { get; internal set; }
|
|
public List<BlogStorageFile> Files { get; internal set; } = [];
|
|
public List<BlogMetaTag> MetaTags { get; set; } = [];
|
|
public Guid AuthorId { get; internal set; }
|
|
public ApplicationUser? Author { get; internal set; }
|
|
|
|
} |