public ModificationFunctionsEndToEndTests()
        {
            // force database initialization, we don't want this to happen inside transaction
            using (var context = new GearsOfWarStoredProceduresContext())
            {
                context.Database.Delete();
                context.Weapons.Count();
            }

            using (var context = new ArubaStoredProceduresContext())
            {
                context.Database.Delete();
                context.Configs.Count();
            }

            using (var context = new FantasyStoredProceduresContext())
            {
                context.Database.Delete();
                context.Creatures.Count();
            }
        }
        public void Update_Fantasy_entities_using_stored_procedures()
        {
            ExtendedSqlAzureExecutionStrategy.ExecuteNew(
                () =>
                {
                    using (new TransactionScope())
                    {
                        using (var context = new FantasyStoredProceduresContext())
                        {
                            var city = context.Cities.OrderBy(c => c.Id).First();
                            var creature = context.Creatures.OrderBy(c => c.Id).First();
                            var province = context.Provinces.OrderBy(h => h.Id).First();
                            var npc = context.Npcs.OrderBy(n => n.Id).First();
                            var spell = context.Spells.OrderBy(s => s.Id).First();

                            city.Name = "Changed City";
                            creature.Details.Attributes.Mana = 123;
                            province.Shape = DbGeometry.FromText("POINT(23 45)", DbGeometry.DefaultCoordinateSystemId);
                            npc.Name = "Changed NPC Name";
                            spell.MagickaCost = 166;

                            context.SaveChanges();
                        }

                        using (var context = new FantasyStoredProceduresContext())
                        {
                            var city = context.Cities.OrderBy(c => c.Id).First();
                            var creature = context.Creatures.OrderBy(c => c.Id).First();
                            var province = context.Provinces.OrderBy(h => h.Id).First();
                            var npc = context.Npcs.OrderBy(n => n.Id).First();
                            var spell = context.Spells.OrderBy(s => s.Id).First();

                            Assert.Equal("Changed City", city.Name);
                            Assert.Equal(123, creature.Details.Attributes.Mana);
                            Assert.Equal(23, province.Shape.XCoordinate);
                            Assert.Equal(45, province.Shape.YCoordinate);
                            Assert.Equal("Changed NPC Name", npc.Name);
                            Assert.Equal(166, spell.MagickaCost);
                        }
                    }
                });
        }