Esempio n. 1
0
        public Exercise Edit(int id, string name, string description, Category category)
        {
            var exercise = this.GetById(id).FirstOrDefault();
            exercise.Name = name;
            exercise.Description = description;
            exercise.Category = category;

            this.exercises.SaveChanges();

            return exercise;
        }
Esempio n. 2
0
        public Exercise Add(string name, string description, Category category)
        {
            var exercise = new Exercise
            {
                Name = name,
                Description = description,
                Category = category
            };

            this.exercises.Add(exercise);
            this.exercises.SaveChanges();

            return exercise;
        }
        public FitnessProgram Add(
            string name, 
            string description,
            Suitable suitableFor,
            Category category)
        {
            var fitnessProgram = new FitnessProgram
            {
                Category = category,
                Name = name,
                Description = description,
                SuitableFor = suitableFor
            };

            this.fitnessPrograms.Add(fitnessProgram);
            this.fitnessPrograms.SaveChanges();

            return fitnessProgram;
        }