Beispiel #1
0
        public void AddTrack(TrackModels track)
        {
            TrackModels track2 = new TrackModels(track.NameTrack, track.BusStopId, track.TimeId);

            dbContext.Tracks.Add(track2);
            dbContext.SaveChanges();
        }
Beispiel #2
0
        public void DeleteTrackByID(int trackID)
        {
            TrackModels track = dbContext.Tracks.Find(trackID);

            dbContext.Tracks.Remove(track);
            dbContext.SaveChanges();
        }
Beispiel #3
0
 public void UpdateTrack(TrackModels track)
 {
     dbContext.Tracks.Find(track.Id).Update(track);
     dbContext.SaveChanges();
 }
 public void Update(TrackModels track)
 {
     NameTrack           = track.NameTrack;
     TimeToNextStopsList = track.TimeToNextStopsList;
     BusStopsList        = track.BusStopsList;
 }