Exemplo n.º 1
0
        static void Main()
        {
            var inputParser = new InputParser("./input/input-2020-12-05.xml");
            var counties    = inputParser.Parse();

            using (var db = new CountyContext())
            {
                foreach (var county in counties)
                {
                    var tmpCounty = db.Counties.Find(county.Name);
                    if (tmpCounty != null)
                    {
                        db.Counties.Remove(tmpCounty);
                    }
                    db.Counties.Add(county);
                }
                db.SaveChanges();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1(db));
            }
        }
Exemplo n.º 2
0
 public Form1(CountyContext db)
 {
     InitializeComponent();
     _context = db;
 }