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

27 lines
1.1 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 BlogCategory : ApiEntity
{
public BlogCategory()
{
}
public BlogCategory(string name,string slug, string description,bool isMain)
{
Name = name;
Slug = slug;
Description = description;
IsMain = isMain;
}
public string Name { get; internal set; } = string.Empty;
public string Slug { get; internal set; } = string.Empty;
public string Description { get; internal set; } = string.Empty;
public bool IsMain { get; set; }
public Guid? ParentId { get; set; }
public BlogCategory? Parent { get; set; }
public List<Blog> Blogs { get; internal set; } = new();
}