From 5568574d9cfd3087f630eac2a35c2f98cd430a7c Mon Sep 17 00:00:00 2001 From: "Tizian.Breuch" Date: Tue, 22 Jul 2025 11:04:52 +0200 Subject: [PATCH] foramttierung --- Webshop.Domain/Class1.cs | 7 ------- Webshop.Domain/Entities/Product.cs | 17 +---------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 Webshop.Domain/Class1.cs diff --git a/Webshop.Domain/Class1.cs b/Webshop.Domain/Class1.cs deleted file mode 100644 index 136ac40..0000000 --- a/Webshop.Domain/Class1.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Webshop.Domain -{ - public class Class1 - { - - } -} diff --git a/Webshop.Domain/Entities/Product.cs b/Webshop.Domain/Entities/Product.cs index 8ce49ec..4407967 100644 --- a/Webshop.Domain/Entities/Product.cs +++ b/Webshop.Domain/Entities/Product.cs @@ -4,9 +4,6 @@ using System.ComponentModel.DataAnnotations; namespace Webshop.Domain.Entities; -/// -/// 1. Das zentrale Modell für deine Verkaufsartikel. -/// public class Product { [Key] @@ -22,18 +19,13 @@ public class Product [MaxLength(500)] public string? ShortDescription { get; set; } - // Unique-Constraint wird typischerweise via Fluent API konfiguriert: - // modelBuilder.Entity().HasIndex(p => p.SKU).IsUnique(); [Required] [MaxLength(50)] public string SKU { get; set; } - // Precision wird typischerweise via Fluent API konfiguriert: - // modelBuilder.Entity().Property(p => p.Price).HasPrecision(18, 2); [Required] public decimal Price { get; set; } - // modelBuilder.Entity().Property(p => p.OldPrice).HasPrecision(18, 2); public decimal? OldPrice { get; set; } [Required] @@ -45,23 +37,18 @@ public class Product [Required] public int StockQuantity { get; set; } - // modelBuilder.Entity().Property(p => p.Weight).HasPrecision(18, 3); + public decimal? Weight { get; set; } - // modelBuilder.Entity().Property(p => p.Width).HasPrecision(18, 2); public decimal? Width { get; set; } - // modelBuilder.Entity().Property(p => p.Height).HasPrecision(18, 2); public decimal? Height { get; set; } - // modelBuilder.Entity().Property(p => p.Length).HasPrecision(18, 2); public decimal? Length { get; set; } [MaxLength(2000)] public string? ImageUrl { get; set; } - // Unique-Constraint wird typischerweise via Fluent API konfiguriert: - // modelBuilder.Entity().HasIndex(p => p.Slug).IsUnique(); [Required] [MaxLength(255)] public string Slug { get; set; } @@ -74,10 +61,8 @@ public class Product [ForeignKey(nameof(Supplier))] public Guid? SupplierId { get; set; } - // modelBuilder.Entity().Property(p => p.PurchasePrice).HasPrecision(18, 2); public decimal? PurchasePrice { get; set; } - // Navigation Properties public virtual Supplier? Supplier { get; set; } public virtual ICollection Variants { get; set; } = new List(); public virtual ICollection Reviews { get; set; } = new List();