Projektdateien hinzufügen.

This commit is contained in:
Webtree-design
2025-07-21 20:17:52 +02:00
parent b5367c704f
commit 16d38a8f39
44 changed files with 4613 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
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 Category
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(255)]
public string Name { get; set; }
[MaxLength(1000)]
public string? Description { get; set; }
// Unique-Constraint wird typischerweise via Fluent API konfiguriert
[Required]
[MaxLength(255)]
public string Slug { get; set; }
[ForeignKey(nameof(ParentCategory))]
public Guid? ParentCategoryId { get; set; }
[MaxLength(2000)]
public string? ImageUrl { get; set; }
[Required]
public bool IsActive { get; set; }
[Required]
public int DisplayOrder { get; set; }
// Navigation Properties
public virtual Category? ParentCategory { get; set; }
public virtual ICollection<Category> SubCategories { get; set; } = new List<Category>();
public virtual ICollection<ProductCategory> ProductCategories { get; set; } = new List<ProductCategory>();
public virtual ICollection<CategoryDiscount> CategoryDiscounts { get; set; } = new List<CategoryDiscount>();
}