naming
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// src/Webshop.Domain/Entities/Category.cs
|
||||
// src/Webshop.Domain/Entities/categorie.cs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@@ -9,7 +9,7 @@ namespace Webshop.Domain.Entities
|
||||
/// <summary>
|
||||
/// Zum Gruppieren und Organisieren von Produkten.
|
||||
/// </summary>
|
||||
public class Category
|
||||
public class categorie
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid(); // Hinzufügen von Default-Wert
|
||||
@@ -25,8 +25,8 @@ namespace Webshop.Domain.Entities
|
||||
[MaxLength(255)]
|
||||
public string Slug { get; set; } = string.Empty; // Hinzufügen von Default-Wert
|
||||
|
||||
[ForeignKey(nameof(ParentCategory))]
|
||||
public Guid? ParentCategoryId { get; set; }
|
||||
[ForeignKey(nameof(Parentcategorie))]
|
||||
public Guid? ParentcategorieId { get; set; }
|
||||
|
||||
[MaxLength(2000)]
|
||||
public string? ImageUrl { get; set; }
|
||||
@@ -43,9 +43,9 @@ namespace Webshop.Domain.Entities
|
||||
// << ENDE NEUE EIGENSCHAFTEN >>
|
||||
|
||||
// Navigation Properties
|
||||
public virtual Category? ParentCategory { get; set; }
|
||||
public virtual ICollection<Category> Subcategorys { get; set; } = new List<Category>();
|
||||
public virtual ICollection<ProductCategory> Productcategorys { get; set; } = new List<ProductCategory>();
|
||||
public virtual ICollection<CategoryDiscount> CategoryDiscounts { get; set; } = new List<CategoryDiscount>();
|
||||
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>();
|
||||
}
|
||||
}
|
||||
@@ -5,19 +5,19 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace Webshop.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Verknüpfungstabelle für die Viele-zu-Viele-Beziehung zwischen Category und Discount.
|
||||
/// Verknüpfungstabelle für die Viele-zu-Viele-Beziehung zwischen categorie und Discount.
|
||||
/// </summary>
|
||||
public class CategoryDiscount
|
||||
public class categorieDiscount
|
||||
{
|
||||
[Required]
|
||||
[ForeignKey(nameof(Category))]
|
||||
public Guid CategoryId { get; set; }
|
||||
[ForeignKey(nameof(categorie))]
|
||||
public Guid categorieId { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey(nameof(Discount))]
|
||||
public Guid DiscountId { get; set; }
|
||||
|
||||
// Navigation Properties
|
||||
public virtual Category Category { get; set; }
|
||||
public virtual categorie categorie { get; set; }
|
||||
public virtual Discount Discount { get; set; }
|
||||
}
|
||||
@@ -51,5 +51,5 @@ public class Discount
|
||||
|
||||
// Navigation Properties
|
||||
public virtual ICollection<ProductDiscount> ProductDiscounts { get; set; } = new List<ProductDiscount>();
|
||||
public virtual ICollection<CategoryDiscount> CategoryDiscounts { get; set; } = new List<CategoryDiscount>();
|
||||
public virtual ICollection<categorieDiscount> categorieDiscounts { get; set; } = new List<categorieDiscount>();
|
||||
}
|
||||
@@ -67,5 +67,5 @@ public class Product
|
||||
public virtual ICollection<ProductVariant> Variants { get; set; } = new List<ProductVariant>();
|
||||
public virtual ICollection<Review> Reviews { get; set; } = new List<Review>();
|
||||
public virtual ICollection<ProductDiscount> ProductDiscounts { get; set; } = new List<ProductDiscount>();
|
||||
public virtual ICollection<ProductCategory> Productcategorys { get; set; } = new List<ProductCategory>();
|
||||
public virtual ICollection<Productcategorie> Productcategories { get; set; } = new List<Productcategorie>();
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace Webshop.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Verknüpfungstabelle für die Viele-zu-Viele-Beziehung zwischen Category und Discount.
|
||||
/// Verknüpfungstabelle für die Viele-zu-Viele-Beziehung zwischen categorie und Discount.
|
||||
/// </summary>
|
||||
public class ProductCategory
|
||||
public class Productcategorie
|
||||
{
|
||||
// Composite Primary Key wird via Fluent API in Ihrem DbContext konfiguriert:
|
||||
// modelBuilder.Entity<ProductCategory>().HasKey(pc => new { pc.ProductId, pc.CategoryId });
|
||||
// modelBuilder.Entity<Productcategorie>().HasKey(pc => new { pc.ProductId, pc.categorieId });
|
||||
|
||||
[ForeignKey(nameof(Product))]
|
||||
public Guid ProductId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(Category))]
|
||||
public Guid CategoryId { get; set; }
|
||||
[ForeignKey(nameof(categorie))]
|
||||
public Guid categorieId { get; set; }
|
||||
|
||||
// Navigation Properties
|
||||
public virtual Product Product { get; set; }
|
||||
public virtual Category Category { get; set; }
|
||||
public virtual categorie categorie { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user