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

35 lines
1.3 KiB
C#

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
{
public Review()
{
}
public Review(string title, string comment, float rate, bool isBuyer,bool isAdmin, Guid productId, Guid userId)
{
Title = title;
Comment = comment;
Rate = rate;
IsBuyer = isBuyer;
IsAdmin = isAdmin;
ProductId = productId;
UserId = userId;
}
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; }
public bool IsAdmin { get; internal set; }
public Guid ProductId { get; internal set; }
public Product? Product { get; internal set; }
public Guid UserId { get; internal set; }
public ApplicationUser? User { get; internal set; }
}