Exemplo n.º 1
0
        public void InitData()
        {
            using (var db = new NannyContext())
            {
                #region Gender

                db.Genders.Add(new Gender
                {
                    Title = "Female",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });
                db.Genders.Add(new Gender
                {
                    Title = "Male",

                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                #endregion Gender

                #region Suburb

                db.Suburbs.Add(new Suburb
                {
                    Name = "Sydney",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.Suburbs.Add(new Suburb
                {
                    Name = "Manly",

                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                #endregion Suburb

                #region Language

                db.Languages.Add(new Language
                {
                    Name = "English",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.Languages.Add(new Language
                {
                    Name = "Portuguese",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.Languages.Add(new Language
                {
                    Name = "Japanese",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.Languages.Add(new Language
                {
                    Name = "Spanish",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                #endregion Language

                #region Language Level

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Beginner",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Elementary",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Pre-Intermediate",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Low Intermediate",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Intermediate",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Upper Intermediate",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Pre-advanced",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Advanced",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                db.LanguageLevels.Add(new LanguageLevel
                {
                    Name = "Very Advanced",
                    DateCreated = DateTime.UtcNow,
                    DateLastUpdated = DateTime.UtcNow
                });

                #endregion Language Level

                db.SaveChanges();
            }
        }