public IActionResult Index()
        {
            var itemDto = _сoachService.GetAll();
            var items   = _mapper.Map <IList <CoachViewModel> >(itemDto);

            return(View("Index", items));
        }
        public IEnumerable <CoachViewModel> Get()
        {
            var itemDto = _сoachService.GetAll();
            var items   = _mapper.Map <IList <CoachViewModel> >(itemDto);

            return(items);
        }
예제 #3
0
        private void ListAllCoaches()
        {
            PrintSpecial(Label("LIST ALL COACHES"));

            try
            {
                List <Coach> coaches = coachService.GetAll();

                if (coaches.Count == 0)
                {
                    Print("None");
                    return;
                }

                foreach (var coach in coaches)
                {
                    PrintSpecial(this.Buffer("COACH"));

                    Print(coach.ToString());
                }
            }
            catch (Exception)
            {
                Print(SomethingWentWrong());
            }
        }
        public SelectCoachModalModalViewModel(IKernel kernel, IMapper mapper, ICoachService coachService) : base(kernel, mapper)
        {
            Coaches = coachService
                      .GetAll()
                      .Select(dto => _mapper.Map(dto, _kernel.Get <ICoachTileViewModel>()))
                      .ToList();

            InitCommands();
        }
        public ValidateCoachModalViewModel(IKernel kernel, IMapper mapper, IHashService hashService, ICoachService coachService) : base(kernel, mapper)
        {
            _hashService  = hashService;
            _coachService = coachService;

            Coaches = coachService
                      .GetAll()
                      .Select(dto => _mapper.Map(dto, _kernel.Get <ICoachTileViewModel>()))
                      .ToList();

            InitCommands();
        }
예제 #6
0
 // GET: Coach
 public ActionResult Index()
 {
     return(View(_service.GetAll()));
 }