public void GetLiveTrainers() { var criteria = new SearchCriteria <TrainerDTO>(); TrainerList = _trainerService.GetAll(criteria).OrderBy(i => i.Id).ToList(); Trainers = new ObservableCollection <TrainerDTO>(TrainerList); }
public ViewViewComponentResult Invoke() { TrainerListViewModel trainerListViewModel = new TrainerListViewModel() { Trainers = _trainerService.GetAll(), }; return(View(trainerListViewModel)); }
public IActionResult Index() { TrainerListViewModel trainerListViewModel = new TrainerListViewModel() { Trainers = _trainerService.GetAll(), }; return(View(trainerListViewModel)); }
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 HttpResponseMessage GetListPaging(HttpRequestMessage request, int page, int pageSize, string filter = null) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; int totalRow; var model = _trainerService.GetAll(page, pageSize, out totalRow, filter); var modelVm = Mapper.Map <IEnumerable <Trainer>, IEnumerable <TrainerViewModel> >(model); var pagedSet = new PaginationSet <TrainerViewModel> { Page = page, TotalCount = totalRow, TotalPages = (int)Math.Ceiling((decimal)totalRow / pageSize), Items = modelVm }; response = request.CreateResponse(HttpStatusCode.OK, pagedSet); return response; })); }
public async Task <IHttpActionResult> GetAll() { var rs = await _trainerService.GetAll(); return(ApiJson(rs)); }
public async Task <IActionResult> GetAll(CancellationToken cancellationToken = default) { return(Ok(await _trainerService.GetAll(cancellationToken))); }