Projektdateien hinzufügen.
This commit is contained in:
41
Webshop.Domain/Entities/Review.cs
Normal file
41
Webshop.Domain/Entities/Review.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Webshop.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Kundenbewertungen für Produkte.
|
||||
/// </summary>
|
||||
public class Review
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey(nameof(Product))]
|
||||
public Guid ProductId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(Customer))]
|
||||
public Guid? CustomerId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Range(1, 5)]
|
||||
public int Rating { get; set; }
|
||||
|
||||
[MaxLength(100)]
|
||||
public string? Title { get; set; }
|
||||
|
||||
[MaxLength(2000)]
|
||||
public string? Comment { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTimeOffset ReviewDate { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool IsApproved { get; set; }
|
||||
|
||||
// Navigation Properties
|
||||
public virtual Product Product { get; set; }
|
||||
public virtual Customer? Customer { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user