This commit is contained in:
Tizian.Breuch
2025-08-01 15:15:48 +02:00
parent 55eeaca7f4
commit 90171fffa2
12 changed files with 265 additions and 265 deletions

View File

@@ -0,0 +1,51 @@
// src/Webshop.Domain/Entities/categorie.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Webshop.Domain.Entities
{
/// <summary>
/// Zum Gruppieren und Organisieren von Produkten.
/// </summary>
public class categorie
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid(); // Hinzufügen von Default-Wert
[Required]
[MaxLength(255)]
public string Name { get; set; } = string.Empty; // Hinzufügen von Default-Wert
[MaxLength(1000)]
public string? Description { get; set; }
[Required]
[MaxLength(255)]
public string Slug { get; set; } = string.Empty; // Hinzufügen von Default-Wert
[ForeignKey(nameof(Parentcategorie))]
public Guid? ParentcategorieId { get; set; }
[MaxLength(2000)]
public string? ImageUrl { get; set; }
[Required]
public bool IsActive { get; set; }
[Required]
public int DisplayOrder { get; set; }
// << NEUE EIGENSCHAFTEN HINZUFÜGEN >>
public DateTimeOffset CreatedDate { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset? LastModifiedDate { get; set; }
// << ENDE NEUE EIGENSCHAFTEN >>
// Navigation Properties
public virtual categorie? Parentcategorie { get; set; }
public virtual ICollection<categorie> Subcategories { get; set; } = new List<categorie>();
public virtual ICollection<Productcategorie> Productcategories { get; set; } = new List<Productcategorie>();
public virtual ICollection<categorieDiscount> categorieDiscounts { get; set; } = new List<categorieDiscount>();
}
}