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)); }
public ViewViewComponentResult Invoke() { FooterViewComponentModel model = new FooterViewComponentModel() { ExerciseTypes = _exerciseTypeService.GetAll(), Exercises = _exerciseService.GetAll(), }; return(View(model)); }
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); })); }
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)); }
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()); }
public async Task <IActionResult> GetAll() { return(Ok(await _excersiseService.GetAll())); }