23 lines
637 B
C#
23 lines
637 B
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Webshop.Domain.Entities;
|
|
|
|
/// <summary>
|
|
/// Verknüpfungstabelle für die Viele-zu-Viele-Beziehung zwischen Product und Discount.
|
|
/// </summary>
|
|
public class ProductDiscount
|
|
{
|
|
[Required]
|
|
[ForeignKey(nameof(Product))]
|
|
public Guid ProductId { get; set; }
|
|
|
|
[Required]
|
|
[ForeignKey(nameof(Discount))]
|
|
public Guid DiscountId { get; set; }
|
|
|
|
// Navigation Properties
|
|
public virtual Product Product { get; set; } = default!;
|
|
public virtual Discount Discount { get; set; } = default!;
|
|
} |