admin sutomer raus

This commit is contained in:
Tizian.Breuch
2025-07-29 14:52:51 +02:00
parent 773bd1a1fe
commit d4255b8c0d

View File

@@ -181,22 +181,6 @@ using (var scope = app.Services.CreateScope())
{ {
await userManager.AddToRoleAsync(adminUser, "Admin"); await userManager.AddToRoleAsync(adminUser, "Admin");
Console.WriteLine("Admin user created."); 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<4B>PFUNG <20>BER AspNetUserId >>
FirstName = "Admin",
LastName = "User"
};
context.Customers.Add(adminCustomerProfile);
await context.SaveChangesAsync();
Console.WriteLine("Admin's Customer profile created.");
}
} }
else else
{ {