Exemplo n.º 1
0
 private NavigationService()
 {
     context = new DB();
     context.Configuration.AutoDetectChangesEnabled = false;
     context.Configuration.ProxyCreationEnabled = false;
     context.Configuration.ValidateOnSaveEnabled = false;
 }
Exemplo n.º 2
0
        private StaticDB()
        {
            SolarSystems = new List<SolarSystem>();
            Regions = new List<Region>();
            Denormalized = new List<Denormalize>();
            using (var context = new DB())
            {
                context.Configuration.LazyLoadingEnabled = false;
                context.Configuration.ProxyCreationEnabled = false;
                context.Configuration.AutoDetectChangesEnabled = false;

                var systems = (from s in context.SolarSystems
                              select s).ToList();

                foreach(var system in systems)
                {
                    SolarSystems.Add(system);
                }
                systems = null;

                var regions = (from s in context.Regions
                              select s).ToList();

                foreach (var s in regions)
                {
                    Regions.Add(s);
                }
                systems = null;

                var locations = (from s in context.Denormalized
                        select s).ToList();

                foreach (var l in locations)
                {
                    Denormalized.Add(l);
                }
                locations = null;
            }
        }