Api/Netina.Domain/Entities/Reviews/Review.cs

35 lines
1.3 KiB
C#
Raw Normal View History

namespace Netina.Domain.Entities.Reviews;
[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 Review : ApiEntity
2023-12-16 20:25:12 +03:30
{
public Review()
{
}
2024-09-21 20:51:01 +03:30
public Review(string title, string comment, float rate, bool isBuyer,bool isAdmin, Guid productId, Guid userId)
{
Title = title;
Comment = comment;
Rate = rate;
IsBuyer = isBuyer;
2024-09-21 20:51:01 +03:30
IsAdmin = isAdmin;
ProductId = productId;
UserId = userId;
}
2023-12-16 20:25:12 +03:30
public string Title { get; internal set; } = string.Empty;
public string Comment { get; internal set; } = string.Empty;
public float Rate { get; internal set; }
public bool IsBuyer { get; internal set; }
public bool IsConfirmed { get; internal set; }
2024-09-21 20:51:01 +03:30
public bool IsAdmin { get; internal set; }
2023-12-16 20:25:12 +03:30
public Guid ProductId { get; internal set; }
public Product? Product { get; internal set; }
public Guid UserId { get; internal set; }
public ApplicationUser? User { get; internal set; }
}