Ejemplo n.º 1
0
 private void ReadEventsTable()
 {
     try
     {
         using var db = new EventsContext();
         var events = db.Events
                      .Include("Location")
                      .OrderBy(e => e.TimeStamp)
                      .ToList();
         events.ForEach(e =>
         {
             Console.WriteLine($"{e.TimeStamp} - {e.Location.Name}");
         });
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error reading data: " + ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void PopulateEventsTable(List <Event> events)
 {
     using var db = new EventsContext();
     db.AddEvents(events);
 }
Ejemplo n.º 3
0
 private void PopulateLocationsTable(List <Location> locations)
 {
     using var db = new EventsContext();
     db.AddLocations(locations);
 }