예제 #1
0
        public static void SaveOrUpdateTraining(Training val)
        {
            var context = new GymTrainingContext();

            context.Entry(val).State = System.Data.Entity.EntityState.Modified;
            context.SaveChanges();
        }
예제 #2
0
파일: Getters.cs 프로젝트: eSamchuk/web
        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();
        }