示例#1
0
 private static void AddGeoZone(string name, Country country, MembershipDB context)
 {
     context.GeoZones.Add(new GeoZone
     {
         Country = country,
         Name = name.Trim(),
         Comment = string.Empty,
         UpdatedOn = DateTime.Now,
         CreatedOn = DateTime.Now,
         LastUpdatedBy = 1
     });
 }
示例#2
0
        public static void InsertCountryTurkeyAndGeoZones(MembershipDB context)
        {
            var countryTurkey = new Country
            {
                Id = 90,
                CountryCode = "tr",
                Name = "Türkiye Cumhuriyeti",
                ShortName = "Türkiye",
                Comment = string.Empty,
                UpdatedOn = DateTime.Now,
                CreatedOn = DateTime.Now,
                LastUpdatedBy = 1
            };
            context.Countries.Add(countryTurkey);
            context.SaveChanges();

            AddGeoZone("Marmara", countryTurkey, context);
            AddGeoZone("Ege", countryTurkey, context);
            AddGeoZone("Akdeniz", countryTurkey, context);
            AddGeoZone("Karadeniz", countryTurkey, context);
            AddGeoZone("Doğu Anadolu", countryTurkey, context);
            AddGeoZone("İç Anadolu", countryTurkey, context);
            AddGeoZone("Güneydoğu Anadolu", countryTurkey, context);

            context.SaveChanges();
        }