admin sutomer raus
This commit is contained in:
@@ -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<4B>PFUNG <20>BER AspNetUserId >>
|
||||
FirstName = "Admin",
|
||||
LastName = "User"
|
||||
};
|
||||
context.Customers.Add(adminCustomerProfile);
|
||||
await context.SaveChangesAsync();
|
||||
Console.WriteLine("Admin's Customer profile created.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user