Example #1
0
        public async Task <IActionResult> GetAllExercises()
        {
            var entities = await _exerciseService.GetAll();

            var result = _mapper.Map <IEnumerable <ExerciseDto> >(entities);

            return(Ok(result));
        }
        public ViewViewComponentResult Invoke()
        {
            ExerciseViewModel exerciseViewModel = new ExerciseViewModel()
            {
                Exercises = _exerciseService.GetAll(),
            };

            return(View(exerciseViewModel));
        }
Example #3
0
        public ViewViewComponentResult Invoke()
        {
            FooterViewComponentModel model = new FooterViewComponentModel()
            {
                ExerciseTypes = _exerciseTypeService.GetAll(),
                Exercises     = _exerciseService.GetAll(),
            };

            return(View(model));
        }
Example #4
0
        public IActionResult Exercise()
        {
            ExerciseViewModel model = new ExerciseViewModel()
            {
                Exercises     = _exerciseService.GetAll(),
                ExerciseTypes = _exerciseTypeService.GetAll(),
            };

            return(View(model));
        }
 public IActionResult Get()
 {
     try
     {
         return(Ok(_exerciseService.GetAll().ToApiModels()));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("GetExercise", ex.StackTrace);
         return(BadRequest(ModelState));
     }
 }
        // GET: api/Exercise
        public IHttpActionResult GetAll()
        {
            LoggerService.Info("Getting all 'Exercises'");

            return(ExecuteRequest(() =>
            {
                var exercisesDTO = _service.GetAll();
                var exercises = _mapper.Map <List <Exercise> >(exercisesDTO);

                LogInfoObjectToJson(exercises);
                return Ok <List <Exercise> >(exercises);
            }));
        }
Example #7
0
        public IActionResult Index()
        {
            HomeViewModel homeViewModel = new HomeViewModel()
            {
                Exercises     = _exerciseService.GetAll(),
                Trainers      = _trainerService.GetAll(),
                ExerciseTypes = _exerciseTypeService.GetAll(),
                BlogPosts     = _blogPostService.GetAll().OrderBy(x => x.Time.Day).ToList(),
            };



            return(View(homeViewModel));
        }
Example #8
0
        public IActionResult GetAll()
        {
            var exercises = _ExerciseService.GetAll();

            return(Ok(exercises));
        }
 public IEnumerable <string> Get() => _exerciseService.GetAll();
 public async Task <IEnumerable <Exercise> > GetExercises()
 {
     return(await _exerciseService.GetAll());
 }
 public List <Exercises> Get()
 {
     return(_service.GetAll());
 }
Example #12
0
 public async Task <IActionResult> GetAll()
 {
     return(Ok(await _excersiseService.GetAll()));
 }