From d4255b8c0d5d19cb845d7c5d3c898d43ef0a241e Mon Sep 17 00:00:00 2001 From: "Tizian.Breuch" Date: Tue, 29 Jul 2025 14:52:51 +0200 Subject: [PATCH] admin sutomer raus --- Webshop.Api/Program.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Webshop.Api/Program.cs b/Webshop.Api/Program.cs index 962f057..bb76208 100644 --- a/Webshop.Api/Program.cs +++ b/Webshop.Api/Program.cs @@ -181,22 +181,6 @@ using (var scope = app.Services.CreateScope()) { await userManager.AddToRoleAsync(adminUser, "Admin"); Console.WriteLine("Admin user created."); - - // Erstelle Customer-Profil für Admin (falls Admins auch Kundenprofile haben sollen) - var adminCustomerProfile = await context.Customers.FirstOrDefaultAsync(c => c.AspNetUserId == adminUser.Id); // << KORREKT: SUCHT NACH AspNetUserId >> - if (adminCustomerProfile == null) - { - adminCustomerProfile = new Webshop.Domain.Entities.Customer - { - Id = Guid.NewGuid(), - AspNetUserId = adminUser.Id, // << KORREKT: VERKNÜPFUNG ÜBER AspNetUserId >> - FirstName = "Admin", - LastName = "User" - }; - context.Customers.Add(adminCustomerProfile); - await context.SaveChangesAsync(); - Console.WriteLine("Admin's Customer profile created."); - } } else {