Exemplo n.º 1
0
        public User AddFitnessProgramToUserPrograms(User user, FitnessProgram fitnessProgram)
        {
            user.FitnessPrograms.Add(fitnessProgram);

            this.users.SaveChanges();

            return user;
        }
Exemplo n.º 2
0
        public User RemoveFitnessProgramFromUserPrograms(User user, FitnessProgram fitnessProgram)
        {
            user.FitnessPrograms.Remove(fitnessProgram);

            this.users.SaveChanges();

            return user;
        }
        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;
        }