Ejemplo n.º 1
0
        public IActionResult Index()
        {
            var plans = _planRepository.GetAllPlans();

            var model = _mapper.Map <IEnumerable <Plan>, IEnumerable <PlanViewModel> >(plans);


            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <List <Plan> > GetAllPlans()
        {
            var plans = await _repository.GetAllPlans();

            return(plans.Select(_mapper.Map <PlanEntity, Plan>).OrderBy(x => x.MonthlyPrice).ToList());
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <SubscriptionPlan> > GetAllPlans()
        {
            var plans = await _planRepository.GetAllPlans();

            return(plans.Select(plan => _mapper.Map <PlanEntity, SubscriptionPlan>(plan)));
        }