public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }


            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with that big park.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Statue of Liberty",
                            Description = "It was built in 1886 and remains a famous world symbol of freedom and one of the greatest American icons."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "Along with the Statue of Liberty, The Empire State Building is New York's most famous landmark. "
                        }
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the cathedral that was never really finished.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Grand Place",
                            Description = "Antwerp's Grand Place (Grote Markt) with its town hall and numerous guild houses is the heart of the old town."
                        },
                        new PointOfInterest()
                        {
                            Name        = "St. Paul's Church",
                            Description = "In the central city, the Veemarkt (the plaza that once functioned as a former cattle market) is home to the late Gothic St."
                        }
                    }
                },
                new City
                {
                    Name             = "Paris",
                    Description      = "The one with that big tower.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Eiffel Tower",
                            Description = "Visiting the iconic symbol of Paris usually ranks as the number one thing to do for most tourists."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Louvre",
                            Description = "Topping the list of the world?s most visited museums, the Louvre Museum is located in the Louvre Palace with its signature glass pyramid marking its entrance."
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            // init seed data
            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with that big park.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in the United States."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper located in Midtown Manhattan."
                        },
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the cathedral that was never really finished.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cathedral",
                            Description = "A Gothic style cathedral, conceived by architects Jan and Pieter Appelmans."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Antwerp Central Station",
                            Description = "The the finest example of railway architecture in Belgium."
                        },
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with that big tower.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Eiffel Tower",
                            Description = "A wrought iron lattice tower on the Champ de Mars, named after engineer Gustave Eiffel."
                        },
                        new PointOfInterest()
                        {
                            Name        = "The Louvre",
                            Description = "The world's largest museum."
                        },
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #3
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            // init dummy data
            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York",
                    Description      = "Big City in USA",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Statue of Liberty",
                            Description = "A big French statue"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "A Park"
                        }
                    }
                },
                new City()
                {
                    Name             = "London",
                    Description      = "Big City in UK",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Big Ben",
                            Description = "A bell"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Houses of Parliament",
                            Description = "A place where shits hang out"
                        }
                    }
                },
                new City()
                {
                    Name             = "Edinburgh",
                    Description      = "City in UK",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Princess Street Garden",
                            Description = "A park"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Another place",
                            Description = "I cant be bothered"
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #4
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            // Init seed data
            #region SeedData
            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one that big park",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in the United States."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper located in Midtown Manhattan."
                        }
                    }
                },
                new City()
                {
                    Name        = "Antwrep",
                    Description = "The one that big park", PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in the United States."
                        },

                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper located in Midtown Manhattan."
                        },
                    }
                },

                new City()
                {
                    Name             = "Paris",
                    Description      = "The one that big park",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in the United States."
                        },

                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper located in Midtown Manhattan."
                        },
                    }
                }
            };
            #endregion

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            //If we already have data, we don't insert anything.
            if (context.Cities.Any())
            {
                return;
            }

            // init seed data
            var cities = new List <City>()
            {
                new City()
                {
                    Name            = "Buenos Aires",
                    Description     = "The Paris of South America",
                    PointOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Obelisco",
                            Description = "Big Obelisk in the city center"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Pink House",
                            Description = "The government house"
                        },
                    }
                },
                new City()
                {
                    Name            = "Resistencia",
                    Description     = "The City of Scultures",
                    PointOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cathedral",
                            Description = "A modern style cathedral"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Democracy Park",
                            Description = "Green space perfect for open activities"
                        },
                    }
                },
                new City()
                {
                    Name            = "Corrientes",
                    Description     = "The City with 'Paje' ",
                    PointOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Costanera",
                            Description = "A space near the river"
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #6
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with the big park.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "Most visited park in the USA."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A big skyscraper in Manhattan."
                        }
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the unfinished cathedra.l",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cathedral of Our Lady",
                            Description = "A gothic style cathedral."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Antwerp Central Station",
                            Description = "Finest example of railway architecture in Belgium."
                        }
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with the big tower.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Eiffel Tower",
                            Description = "A wrought iron lattice tower on the Champ de Mars."
                        },
                        new PointOfInterest()
                        {
                            Name        = "The Louvre",
                            Description = "The world's largest museum."
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #7
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            //init seed data
            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with the big park.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in the United States."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper located in Midtown Manhattan."
                        }
                    }
                },
                new City()
                {
                    Name             = "Rapa Nui",
                    Description      = "The one with the stone men sculptures.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Anakena",
                            Description = "The most visited beach located in Rapa Nui."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Rano Raraku",
                            Description = "The most visited volcano located in Rapa Nui."
                        }
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with that big tower",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Eiffel Tower",
                            Description = "A wrought iron lattice tower on the Champ de Mars."
                        },
                        new PointOfInterest()
                        {
                            Name        = "The louvre",
                            Description = "The world's largest museum."
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #8
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York",
                    Description      = "The one with that big park.",
                    PointsOfinterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited one."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A very big building."
                        }
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the cathedral that was never finished.",
                    PointsOfinterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited one."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A very big building."
                        }
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with that big tower.",
                    PointsOfinterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited one."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A very big building."
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            // init seed data
            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "Court House Green",
                    Description      = "Austin Drive, Coventry, England",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Post Code:",
                            Description = "CV6 7NS"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Telephone",
                            Description = "024 7666 4477"
                        },
                    }
                },
                new City()
                {
                    Name             = "London Colney",
                    Description      = "Colney Fields Shopping Park, St. Albans, England",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Post Code:",
                            Description = "AL2 1AB"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Telephone",
                            Description = "01707 429220"
                        },
                    }
                },
                new City()
                {
                    Name             = "Nuneaton",
                    Description      = "Vicarage Street, Nuneaton, England",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Post Code:",
                            Description = "CV11 4XS"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Telephone",
                            Description = "02476 375880"
                        },
                    }
                },
                new City()
                {
                    Name             = "Milton Keynes",
                    Description      = "799 Witan Gate, Milton Keynes, England",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Post Code:",
                            Description = "MK9 2FW"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Telephone",
                            Description = "01908 674154"
                        },
                    }
                },
                new City()
                {
                    Name             = "Leicester North",
                    Description      = "501 Melton Road, Leicester, England",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Post Code:",
                            Description = "LE4 7SJ"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Telephone",
                            Description = "0116 2018180"
                        },
                    }
                },
                new City()
                {
                    Name             = "Southampton Portswood",
                    Description      = "224 Portswood Road, Southampton, England",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Post Code:",
                            Description = "SO17 2LB"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Telephone",
                            Description = "023 81242821"
                        },
                    }
                },
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #10
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with that big park",
                    PointsOfInterest = new List <PointOfInterest>
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cental Park",
                            Description = "The most visited park in US"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A skyscraper located in midtown of Manhattan"
                        }
                    }
                },
                new City()
                {
                    Name             = "Toronto",
                    Description      = "The one with one of the tallest towers",
                    PointsOfInterest = new List <PointOfInterest>
                    {
                        new PointOfInterest()
                        {
                            Name        = "CN Tower",
                            Description = "The highest tower in North America"
                        },
                        new PointOfInterest()
                        {
                            Name        = "High Park",
                            Description = "The best park to visit in Toronto"
                        }
                    }
                },
                new City()
                {
                    Name             = "Montreal",
                    Description      = "The one where everybody speaks French",
                    PointsOfInterest = new List <PointOfInterest>
                    {
                        new PointOfInterest()
                        {
                            Name        = "The River",
                            Description = "A well-known river of the city of Montreal"
                        },
                        new PointOfInterest()
                        {
                            Name        = "The Castle",
                            Description = "A huge and beatiful castle"
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #11
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            //Init Seed Data

            var cities = new List <City>()
            {
                new City()
                {
                    Name            = "Lagos",
                    Description     = "Center of excellence",
                    PointOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Ikeja",
                            Description = "Computer Village"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Victoria Island",
                            Description = "Home of the rich men"
                        }
                    }
                },
                new City()
                {
                    Name            = "Abeokuta",
                    Description     = "Rockcity",
                    PointOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Ayetoro",
                            Description = "Jenifer's  Village"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Itoku",
                            Description = "Home of adire"
                        }
                    }
                },
                new City()
                {
                    Name            = "Ibadan",
                    Description     = "Center of amala dudu",
                    PointOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Challenge",
                            Description = "Main garage"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Jerico GRA",
                            Description = "Estate for the rich kid"
                        }
                    }
                },
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            //seed data
            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "Cleveland",
                    Description      = "Party wit da best in the land",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "R&R Hall Of Fame",
                            Description = "Weowweow",
                        },
                        new PointOfInterest()
                        {
                            Name        = "The Flats",
                            Description = "Drink Drank Drunk",
                        }
                    }
                },
                new City()
                {
                    Name             = "Shittsburgh",
                    Description      = "Party wit nobody cool",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Mountain",
                            Description = "Pretty",
                        },
                        new PointOfInterest()
                        {
                            Name        = "Steelers Fans",
                            Description = "Not pretty",
                        }
                    }
                },
                new City()
                {
                    Name             = "Detroit",
                    Description      = "Maaaaan that be real gross",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cars",
                            Description = "Omg wow cars",
                        },
                        new PointOfInterest()
                        {
                            Name        = "The Hood",
                            Description = "Gun violence",
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            // init seed data...
            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with that big park.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in US."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper."
                        }
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the cathedral that was never really finished.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cathedral",
                            Description = "Not finished."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Something",
                            Description = "Bla bla bla."
                        }
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with that big tower.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Eiffel Tower",
                            Description = "Famous tower."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Something",
                            Description = "Bla bla bla."
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            var Cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with the big park.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urbain park in the USA"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper in Midtown."
                        }
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the cathedral they never finished.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cethedral of Our Lady",
                            Description = "Gothic style cathedral"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Antwerp Central Station",
                            Description = "A fine railway structure"
                        }
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with the point tower.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "The Eiffel Town",
                            Description = "A wrought iron lattice tower"
                        },
                        new PointOfInterest()
                        {
                            Name        = "The Louvre",
                            Description = "The world's Largest museum."
                        }
                    }
                }
            };

            context.Cities.AddRange(Cities);
            context.SaveChanges();
        }
        public static void EnsureSeedForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }

            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with the big park",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in the United States."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper located in Midtown Manhattan."
                        }
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the cathederal that was never really finished",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Cathedral of Our Lady",
                            Description = "A Gothic style cathedral."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Antwerp Central Station",
                            Description = "The finest example of railway architecture in Belgium."
                        }
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with the big tower",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Eiffel Tower",
                            Description = "A wrought iron lattice tower on the Champ de Mars."
                        },
                        new PointOfInterest()
                        {
                            Name        = "The Louvre",
                            Description = "The worlds larget museum."
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }
Пример #16
0
        public static void EnsureSeedDataForContext(this CityInfoContext context)
        {
            if (context.Cities.Any())
            {
                return;
            }


            var cities = new List <City>()
            {
                new City()
                {
                    Name             = "New York City",
                    Description      = "The one with that big park, hey now!",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Central Park",
                            Description = "The most visited urban park in the United States."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Empire State Building",
                            Description = "A 102-story skyscraper located in Midtown Manhatten."
                        }
                    }
                },
                new City()
                {
                    Name             = "Antwerp",
                    Description      = "The one with the cathedral that was never really finished.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Some Cathedral",
                            Description = "They ran out of money!"
                        },
                        new PointOfInterest()
                        {
                            Name        = "Antwerp Zoo",
                            Description = "Oldest animal park in the counry and one of the oldest in the world.."
                        }
                    }
                },
                new City()
                {
                    Name             = "Paris",
                    Description      = "The one with that big tower.",
                    PointsOfInterest = new List <PointOfInterest>()
                    {
                        new PointOfInterest()
                        {
                            Name        = "Eiffle Tower",
                            Description = "Wrought iron lattice tower on the Champ de Mars in Paris."
                        },
                        new PointOfInterest()
                        {
                            Name        = "Nothign else",
                            Description = "Please move on."
                        }
                    }
                }
            };

            context.Cities.AddRange(cities);
            context.SaveChanges();
        }