Esempio n. 1
0
        public async Task SeedAsync(IApplicationDbContext context)
        {
            if (!await context.Stats.AnyAsync())
            {
                var doctors = ApplicationDbSeed.GetReferences <List <Doctor> >(DoctorsSeed.GetReferenceKeyName());

                foreach (var doctor in doctors)
                {
                    var stats = new Stats(9.2, 25, 1, 0, doctor);

                    await context.Stats.AddAsync(stats);
                }

                await context.SaveChangesAsync();
            }
        }
Esempio n. 2
0
        public async Task SeedAsync(IApplicationDbContext context)
        {
            if (!await context.Specialties.AnyAsync())
            {
                List <Specialty> references = new List <Specialty>();

                var cities = ApplicationDbSeed.GetReferences <List <City> >(nameof(CitiesSeed));

                foreach (City city in cities)
                {
                    var specialties = new List <Specialty>
                    {
                        new Specialty {
                            Title = "Невролог", Alias = "nevrolog", City = city
                        },
                        new Specialty {
                            Title = "Отоларинголог", Alias = "otolaringolog-lor", City = city
                        },
                        new Specialty {
                            Title = "Психолог", Alias = "psiholog", City = city
                        },
                        new Specialty {
                            Title = "Трихолог", Alias = "triholog", City = city
                        },
                        new Specialty {
                            Title = "Косметолог", Alias = "kosmetolog", City = city
                        },
                        new Specialty {
                            Title = "Ортодонт", Alias = "ortodont", City = city
                        }
                    };

                    foreach (var specialty in specialties)
                    {
                        await context.Specialties.AddAsync(specialty);

                        references.Add(specialty);
                    }
                }

                await context.SaveChangesAsync();

                ApplicationDbSeed.SetReferences(GetReferenceKeyName(), references);
            }
        }
        public async Task SeedAsync(IApplicationDbContext context)
        {
            if (!await context.DoctorSpecialties.AnyAsync())
            {
                var doctors     = ApplicationDbSeed.GetReferences <List <Doctor> >(DoctorsSeed.GetReferenceKeyName());
                var specialties = ApplicationDbSeed.GetReferences <List <Specialty> >(SpecialtiesSeed.GetReferenceKeyName());

                foreach (var doctor in doctors)
                {
                    foreach (var specialty in specialties)
                    {
                        await context.DoctorSpecialties.AddAsync(new DoctorSpecialty(doctor, specialty));
                    }
                }

                await context.SaveChangesAsync();
            }
        }
Esempio n. 4
0
        public async Task SeedAsync(IApplicationDbContext context)
        {
            if (!await context.Informations.AnyAsync())
            {
                var doctors = ApplicationDbSeed.GetReferences <List <Doctor> >(DoctorsSeed.GetReferenceKeyName());

                foreach (var doctor in doctors)
                {
                    var informations = new List <Information>
                    {
                        new Information(InformationType.WorkExperience,
                                        "1993 г. - невролог в Цетральном военном госпитале (СГВ, Польша)", 1, doctor),
                        new Information(InformationType.WorkExperience,
                                        "2013 г. - заведующая отделением специализированного приема Центральной Районной поликлиники Деснянського р-на, внештатный главный невролог района",
                                        1, doctor),
                        new Information(InformationType.WorkExperience,
                                        "2010 г.- невропатолог клиники «Эфферентной терапии»", 1, doctor),
                        new Information(InformationType.WorkExperience, "2016 г. - невролог клиники «ХелсиЕндХеппи»", 1,
                                        doctor),

                        new Information(InformationType.Procedures, "консультативный прием", 2, doctor),
                        new Information(InformationType.Procedures, "осмотр и изучение анамнеза", 2, doctor),
                        new Information(InformationType.Procedures, "назначение и коррекция схемы лечения", 2, doctor),


                        new Information(InformationType.Education,
                                        "Львовский национальный медицинский университет им Д. Галицкого - педиатрия (2002)", 3,
                                        doctor),
                    };

                    foreach (var information in informations)
                    {
                        await context.Informations.AddAsync(information);
                    }
                }

                await context.SaveChangesAsync();
            }
        }