36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
namespace Netina.Domain.Entities.Comments;
|
|
[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 Comment : ApiEntity
|
|
{
|
|
public Comment()
|
|
{
|
|
|
|
}
|
|
|
|
public Comment(string title, string content, float rate, bool isAdmin, Guid userId)
|
|
{
|
|
Title = title;
|
|
Content = content;
|
|
Rate = rate;
|
|
IsAdmin = isAdmin;
|
|
IsRoot = true;
|
|
UserId = userId;
|
|
}
|
|
public string Title { get; internal set; } = string.Empty;
|
|
public string Content { get; internal set; } = string.Empty;
|
|
public float Rate { get; internal set; }
|
|
public bool IsConfirmed { get; internal set; }
|
|
public bool IsAdmin { get; internal set; }
|
|
public bool IsRoot { get; internal set; }
|
|
public Guid? ParentId { get; internal set; }
|
|
public Comment? Parent { get; internal set; }
|
|
|
|
|
|
public List<Comment> Children { get; internal set; } = new();
|
|
|
|
public Guid UserId { get; internal set; }
|
|
public ApplicationUser? User { get; internal set; }
|
|
} |