Esempio n. 1
0
        public static void SaveOrUpdateTraining(Training val)
        {
            var context = new GymTrainingContext();

            context.Entry(val).State = System.Data.Entity.EntityState.Modified;
            context.SaveChanges();
        }
Esempio n. 2
0
        public static void DeleteTraining(decimal id)
        {
            var context = new GymTrainingContext();

            var remove = context.Trainings.Single(x => x.Id == id);

            context.Trainings.Remove(remove);
            context.SaveChanges();
        }