Пример #1
0
        private static void SeedData(MovieDbLiteContext dbContext)
        {
            dbContext.RestrictionRating.Add(new RestrictionRating()
            {
                Id               = (int)MVC.DbEnum.RestrictionRating.G,
                Code             = "G",
                ShortDescription = "G",
                LongDescription  = "Don't Matter",
                IsActive         = true
            });
            dbContext.RestrictionRating.Add(new RestrictionRating()
            {
                Id               = (int)MVC.DbEnum.RestrictionRating.PG,
                Code             = "PG",
                ShortDescription = "G",
                LongDescription  = "Don't Matter",
                IsActive         = true
            });

            dbContext.Genre.Add(new MVC.Models.Genre()
            {
                Id        = 1,
                GenreName = "Thriller",
            });

            dbContext.Genre.Add(new MVC.Models.Genre()
            {
                Id        = 2,
                GenreName = "Action",
            });

            dbContext.SaveChanges();
        }