public void AddExercise(CreateExerciseViewModel model)
 {
     using (var db = new GainTrackerContext(ACTIVE_CONNECTION))
     {
         db.Exercises.Add(Mapper.Map<Exercise>(model));
         db.SaveChanges();
     }
 }
        public ActionResult AddExercise(CreateExerciseViewModel model)
        {
            if (!ModelState.IsValid)
                return View(model);

            repository.AddExercise(model);

            return RedirectToAction("Index", "Admin");
        }