Exemplo n.º 1
0
        private void SeedRoles(WyfDbContext context)
        {
            var roleStore   = new RoleStore <IdentityRole>(context);
            var roleManager = new RoleManager <IdentityRole>(roleStore);
            var allRoles    = new string[] { "User", "Admin", "Employer", "Employee" };

            foreach (var role in allRoles)
            {
                if (!roleManager.RoleExists(role))
                {
                    roleManager.Create(new IdentityRole(role));
                }
            }

            context.SaveChanges();
        }
Exemplo n.º 2
0
        private void SeedCities(WyfDbContext context)
        {
            string[] citiesToSeed = new[]
            {
                "Blagoevgrad",
                "Burgas",
                "Dobrich",
                "Gabrovo",
                "Haskovo",
                "Kardzhali",
                "Kyustendil",
                "Lovech",
                "Montana",
                "Pazardzhik",
                "Pernik",
                "Pleven",
                "Plovdiv",
                "Razgrad",
                "Ruse",
                "Shumen",
                "Svishtov",
                "Silistra",
                "Sliven",
                "Smolyan",
                "Sofia",
                "Sofia Region",
                "Stara Zagora",
                "Targovishte",
                "Varna",
                "Veliko Tarnovo",
                "Vidin",
                "Vratsa",
                "Yambol",
                "Other Bulgarian",
                "Other Abroad"
            };

            foreach (var cityName in citiesToSeed)
            {
                context.Cities.AddOrUpdate(c => c.Name, new City()
                {
                    Name = cityName
                });
                context.SaveChanges();
            }
        }
Exemplo n.º 3
0
        private void SeedIndustries(WyfDbContext context)
        {
            string[] industries = new[]
            {
                "Accounting, Auditing",
                "Administrative And Support Services",
                "Advertising, Marketing, Pr",
                "Agriculture, Forestry And Fishing",
                "Architectural Services",
                "Arts, Entertainment",
                "Automobile Industry",
                "Banking, Finance, Investments",
                "Beauty Parlour",
                "Chemistry And Chemical Technologies",
                "Computer Hardware",
                "Computer Software",
                "Construction",
                "Consulting",
                "Courier Services",
                "Design, Computer Design, Creative",
                "Education, Training, Library",
                "Electronics, Electrotechnics",
                "Energetics, Electricity",
                "Engineering",
                "Food Industry",
                "Governmental, Municipal",
                "Healthcare, Medicine",
                "HR, Employment",
                "Insurance",
                "Internet, e-Commerce",
                "IT",
                "Legal, Law Enforcement",
                "Maintenance Support",
                "Management",
                "Manufacturing, Production",
                "Media",
                "Military",
                "Mining",
                "Non-Profit, Social Service",
                "Personal Care",
                "Pharmaceutical, Biotechnology",
                "Policy Making",
                "Real Estate",
                "Restaurant, Food Services",
                "Sales, Customer Support",
                "Security Services",
                "Social Activities",
                "Science",
                "Sports, Recreation, Rehabilitation",
                "Telecommunication",
                "Textile Industry",
                "Tourism, Hospitality",
                "Trade-Retail, Wholesale",
                "Translation Services",
                "Transportation, Logistics",
                "Other"
            };

            foreach (var industryName in industries)
            {
                context.Industries.AddOrUpdate(c => c.Name, new Industry()
                {
                    Name = industryName
                });
                context.SaveChanges();
            }
        }