Ejemplo n.º 1
0
        public void Post([FromBody] Train newTrain)
        {
            bestdbContext context = new bestdbContext();

            context.Trains.Add(newTrain);
            context.SaveChanges();
        }
Ejemplo n.º 2
0
        public void Delete(int id)
        {
            bestdbContext context = new bestdbContext();

            var deleteTrain = (from x in context.Trains where x.Id == id select x).FirstOrDefault();

            context.Trains.Remove(deleteTrain);
            context.SaveChanges();
        }