Esempio n. 1
0
 public void Post([FromBody] Felszalla busesOnTheRoad)
 {
     using (trafficEntities db = new trafficEntities())
     {
         db.Felszallas.Add(busesOnTheRoad);
         db.SaveChanges();
     }
 }
Esempio n. 2
0
 public void Put(int id, [FromBody] Felszalla busesOnTheRoad)
 {
     using (trafficEntities dbContext = new trafficEntities())
     {
         var entity = dbContext.Felszallas.FirstOrDefault(e => e.buszId == id);
         entity.buszId  = busesOnTheRoad.buszId;
         entity.vonalId = busesOnTheRoad.vonalId;
         entity.lat     = busesOnTheRoad.lat;
         entity.lon     = busesOnTheRoad.lon;
         entity.datum   = busesOnTheRoad.datum;
         dbContext.SaveChanges();
     }
 }