public RecommendationsView() { InitializeComponent(); _viewModel = new RecommendationsViewModel(); this.DataContext = _viewModel; }
protected override void Init(Bundle savedInstanceState) { ViewModel = ViewModelLocator.Recommendations; ViewModel.PopulateData(); if (_args != null) { ViewModel.PivotItemIndex = _args.Index; } ViewModelLocator.NavMgr.DeregisterBackNav(); ViewModelLocator.NavMgr.RegisterBackNav(PageIndex.PageAnimeList, null); }
public ViewResult Recommendations() { var recommenderMovies = _userDataProvider.GetRecommendedMoviesWithSimilarity(ApplicationUser); var viewModel = new RecommendationsViewModel() { Movies = recommenderMovies }; return(View(viewModel)); }
// GET: Recommender public ActionResult BookRecommendations() { int userId = Convert.ToInt32(Session["userId"]); List <int> recommendationIds = _recommenderService.GetRecommendations(userId); RecommendationsViewModel booksRecommended = new RecommendationsViewModel(); booksRecommended.BooksRecommended = _recommenderService.GetBooksRecommended(recommendationIds); booksRecommended.BooksByUsersFavouriteAuthors = _recommenderService.GetBooksFromAuthorsAUserLiked(userId); booksRecommended.UserId = userId; return(View(booksRecommended)); }
public ActionResult Index(IEnumerable <Recommendation> recommendations) { if (recommendations == null || !recommendations.Any()) { return(new EmptyResult()); } var viewModel = new RecommendationsViewModel { Products = _recommendationService.GetRecommendedProductTileViewModels(recommendations) }; return(PartialView("_Recommendations", viewModel)); }
public ActionResult Index(IEnumerable <ContentReference> entryLinks) { if (!entryLinks.Any()) { return(new EmptyResult()); } var viewModel = new RecommendationsViewModel { Products = _productService.GetProductTileViewModels(entryLinks) }; return(PartialView("_Recommendations", viewModel)); }
public ActionResult Recommendations() { RecommendationsViewModel model = new RecommendationsViewModel(); List <Auction> auctions = RetrieveAuctionsFromCache(); model.RecommendedAuctionItems = AuctionSuggestions.GetSuggestions(auctions); if (!model.RecommendedAuctionItems.Any()) { model.ErrorMessage = "No recommendations found"; } return(View(model)); }
public async Task <IActionResult> Recommendations(string artistsIDs, string genresIDs) { RecommendationsViewModel model = new RecommendationsViewModel(); RecommendationsResponseDTO recommendations; recommendations = await GetRecommendations(artistsIDs, genresIDs); // fill release year for all recommended albums for (int i = 0; i < recommendations.Tracks.Length; i++) { recommendations.Tracks[i].Album.Release_Year = await rest.GetAlbumReleaseYearAsync(await RetrieveToken(), recommendations.Tracks[i].Album.ID); } model.Recommendations = recommendations; return(View(model)); }
public async Task <IActionResult> Recommendations() { User user = await _userManager.GetUserAsync(this.User); List <UserPreference> userPreferences = _dbContext.UserPreferences .Where(up => up.UserId == _userManager.GetUserId(this.User)).ToList(); List <Book> books = _dbContext.Books.Where(b => b.Reviews.All(r => r.User != user)).ToList(); for (int i = 0; i < books.Count; i++) { List <Category> categories = _dbContext.Categories .Where(c => c.BookCategories.Any(bc => bc.BookId == books[i].BookId)).ToList(); books[i].UserPreferenceValue = CalculatePreference(userPreferences.Where(up => categories.Contains(up.Category)).ToList()); } RecommendationsViewModel recommendationsViewModel = new RecommendationsViewModel { RecommendedBooks = books.OrderByDescending(b => b.UserPreferenceValue).Take(10).ToList(), ProvidedEnoughReviews = _dbContext.Reviews.Count(r => r.User == user) >= 3 }; return(View(recommendationsViewModel)); }
public void Include(RecommendationsViewModel vm) { vm.PopulateData(); var vm1 = new RecommendationsViewModel(); }
public RecommendationsView() { ViewModel = RecommendationsViewModel.Instanse; this.InitializeComponent(); }
public static DroppyMenuPopup BuildForRecommendationsPage(Context context, View parent, RecommendationsViewModel viewModel, Action <int> callback) { AnimeListPageFlyoutBuilder.ParamRelativeLayout = new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(200), DimensionsHelper.DpToPx(38)); var droppyBuilder = new DroppyMenuPopup.Builder(context, parent); AnimeListPageFlyoutBuilder.InjectAnimation(droppyBuilder); droppyBuilder.AddMenuItem(new DroppyMenuCustomItem(AnimeListPageFlyoutBuilder.BuildItem(context, "Anime recommendations", callback, 0))); droppyBuilder.AddMenuItem(new DroppyMenuCustomItem(AnimeListPageFlyoutBuilder.BuildItem(context, "Manga recommendations", callback, 1))); return(droppyBuilder.Build()); }