예제 #1
0
        public IActionResult Index()
        {
            var plans = _planRepository.GetAllPlans();

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


            return(View(model));
        }
예제 #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());
        }
예제 #3
0
        public async Task <IEnumerable <SubscriptionPlan> > GetAllPlans()
        {
            var plans = await _planRepository.GetAllPlans();

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