private static void SeedClients(UserManager <ApplicationUser> userManager, IServiceProvider serviceProvider) { using (var context = new IdentityContext(serviceProvider.GetRequiredService <DbContextOptions <IdentityContext> >())){ if (context.Client.Any()) { Console.WriteLine("RETURN"); return; } ; } for (int i = 0; i < Clients.ClientNames.Count(); i++) { Console.WriteLine("numero de clientes " + i.ToString()); CreateClient(Clients.ClientNames[i], Clients.ClientDOBs[i], Clients.ClientMail[i], IdentityData.AdminPassword, userManager); } }
private static void SeedTechnicians(UserManager <ApplicationUser> userManager, IServiceProvider serviceProvider) { using (var context = new IdentityContext(serviceProvider.GetRequiredService <DbContextOptions <IdentityContext> >())){ if (context.Technician.Any()) { return; } ; } for (int i = 0; i <= Technicians.TechnicianNames.Count() - 1; i++) { Console.WriteLine("numero de tecnicos " + i.ToString()); CreateTechnician( Technicians.TechnicianNames[i], Technicians.TechnicianDOBs[i], Technicians.TechnicianMail[i], IdentityData.AdminPassword, Technicians.Specialities[i], Technicians.Levels[i], userManager); } }
public DetailsModel(RazorPagesIgnis.Areas.Identity.Data.IdentityContext context) { _context = context; }