コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public DetailsModel(RazorPagesIgnis.Areas.Identity.Data.IdentityContext context)
 {
     _context = context;
 }