public ActionResult Index() { var users = this.userService .GetAll() .MapTo <UserDetailsViewModel>() .ToList(); var cities = this.cityService .GetAll() .MapTo <CityDetailsViewModel>() .ToList(); var clubs = this.clubService .GetAll() .MapTo <ClubDetailsViewModel>() .ToList(); var model = new AllDetailsViewModel() { Users = users, Cities = cities, Clubs = clubs }; return(this.View(model)); }
public async Task <IActionResult> Details(string id) { var detailsInfo = await this.productsService.GetById(id); detailsInfo.Reviews = await this.reviewService.GetReviewsForProduct(id); var recommendedProducts = await this.productsService.GetRecommendationProducts(); AllDetailsViewModel productModel = new AllDetailsViewModel { DetailsInfo = detailsInfo, ReviewModel = new ReviewBindingModel { ProductId = id }, RecommendedProducts = recommendedProducts.ToList(), }; return(this.View(productModel)); }
public AllDetailsView() { InitializeComponent(); BindingContext = new AllDetailsViewModel(); }