コード例 #1
0
        public void SeedRooms(NorthwindDbContext context)
        {
            var rooms = new[]
            {
                new Room()
                {
                    RoomId = 1, RoomNumber = 15, RoomCapacity = 30
                },
                new Room()
                {
                    RoomId = 2, RoomNumber = 15, RoomCapacity = 30
                },
                new Room()
                {
                    RoomId = 3, RoomNumber = 15, RoomCapacity = 30
                },
                new Room()
                {
                    RoomId = 4, RoomNumber = 15, RoomCapacity = 30
                },
                new Room()
                {
                    RoomId = 5, RoomNumber = 15, RoomCapacity = 30
                },
                new Room()
                {
                    RoomId = 6, RoomNumber = 15, RoomCapacity = 30
                }
            };

            context.Rooms.AddRange(rooms);

            context.SaveChanges();
        }
コード例 #2
0
        private void SeedRatings(NorthwindDbContext context)
        {
            var ratings = new[]
            {
                new Rating {
                    GameId = 1, RatingValue = 5
                },
                new Rating {
                    GameId = 2, RatingValue = 1
                },
                new Rating {
                    GameId = 3, RatingValue = 3
                },
            };

            context.Ratings.AddRange(ratings);

            context.SaveChanges();
        }
コード例 #3
0
        public void SeedGames(NorthwindDbContext context)
        {
            var games = new[]
            {
                new Game {
                    Title = "Gears of War 3", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                },
                new Game {
                    Title = "Step Up for Kinnect", Description = "Integer magna magna, iaculis euismodtincidunt a, cursus ac dolor. Aenean quis egestas diam. Pellentesque purus ipsum, elementum sit amet malesuada eget, aliquet eu magna. Nullam magna massa, sodales nec imperdiet quis, consectetur eget nisl. Aenean eget velit in eros porta dictum. Sed eu dui in augu"
                },
                new Game {
                    Title = "Dead Island", Description = "Vivamus purus eros, aliquet malesuada gravida at, fringilla vel elit. Mauris vestibulum, erat at volutpat semper, metus enim faucibus nunc, in ultrices magna enim in justo"
                },
            };

            context.Games.AddRange(games);

            context.SaveChanges();
        }
コード例 #4
0
        public void SeedRooms(NorthwindDbContext context)
        {
            var rooms = new[]
            {
                new Room()
                {
                    RoomId       = 1,
                    RoomNumber   = 1,
                    RoomCapacity = 4,
                    Notes        = "Andrew received his BTS commerciad to vice preside",
                },

                new Room()
                {
                    RoomId       = 2,
                    RoomNumber   = 2,
                    RoomCapacity = 4,
                    Notes        = "Andrew receivific Rim Importers Association.",
                },

                new Room()
                {
                    RoomId       = 3,
                    RoomNumber   = 2,
                    RoomCapacity = 4,
                    Notes        = "Andrew",
                },


                new Room()
                {
                    RoomId       = 4,
                    RoomNumber   = 4,
                    RoomCapacity = 4,
                    Notes        = "Andrew received his BTS commercial in 1974 and a Ph.Ds Association.",
                },


                new Room()
                {
                    RoomId       = 5,
                    RoomNumber   = 4,
                    RoomCapacity = 4,
                    Notes        = "Andrew received his BTS commercial in 1974 and a Ph.Ds Association.",
                },


                new Room()
                {
                    RoomId       = 6,
                    RoomNumber   = 4,
                    RoomCapacity = 4,
                    Notes        = "Andrew received his BTS commercial in 1974 and a Ph.Ds Association.",
                },


                new Room()
                {
                    RoomId       = 7,
                    RoomNumber   = 4,
                    RoomCapacity = 4,
                    Notes        = "Andrew received his BTS commercial in 1974 and a Ph.Ds Association.",
                }
            };


            context.Rooms.AddRange(rooms);

            context.SaveChanges();
        }