예제 #1
0
        public void AddPedestrian(PedestrianDTO pedestrianDTO)
        {
            PedestrianModel pedestrian = new PedestrianModel(this, pedestrianDTO);

            pedestrian.SaveDb();
            _pedestrians.ModifyCollection(col => col.Add(pedestrian));
        }
예제 #2
0
 public void LoadDb()
 {
     PedestriansInfo[] cities;
     using (DatabaseModel dbContext = new DatabaseModel())
     {
         dbContext.Set <PedestriansInfo>().Load();
         cities = dbContext.Set <PedestriansInfo>().ToArray();
     }
     _pedestrians.ModifyCollection(col =>
     {
         col.Clear();
         foreach (PedestriansInfo pedestrianDA in cities)
         {
             PedestrianModel pedestrian = new PedestrianModel(this, pedestrianDA);
             pedestrian.LoadDb();
             col.Add(pedestrian);
         }
     });
 }