public IActionResult Index() { var plans = _planRepository.GetAllPlans(); var model = _mapper.Map <IEnumerable <Plan>, IEnumerable <PlanViewModel> >(plans); return(View(model)); }
public async Task <List <Plan> > GetAllPlans() { var plans = await _repository.GetAllPlans(); return(plans.Select(_mapper.Map <PlanEntity, Plan>).OrderBy(x => x.MonthlyPrice).ToList()); }
public async Task <IEnumerable <SubscriptionPlan> > GetAllPlans() { var plans = await _planRepository.GetAllPlans(); return(plans.Select(plan => _mapper.Map <PlanEntity, SubscriptionPlan>(plan))); }