Api/Netina.Domain/Entities/Blogs/Blog.cs

36 lines
1.5 KiB
C#

namespace Netina.Domain.Entities.Blogs;
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { 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)
{
Title = title;
Content = content;
Tags = tags;
ReadingTime = readingTime;
Summery = summery;
IsSuggested = isSuggested;
CategoryId = categoryId;
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; } = new();
}