public ActionResult Index() { var userId = this.User.Identity.GetUserId(); var restaurants = this.users.GetFavourites(userId, string.Empty, (int)OrderByType.Name).To<RegularUserFavouriteViewModel>().ToList(); var model = new UserFavouritesViewModel { OrderBy = OrderByType.Name, Restaurants = restaurants }; return this.View(model); }
public ActionResult Index() { var userId = this.User.Identity.GetUserId(); var restaurants = this.users.GetFavouriteRestaurants(userId, string.Empty, RestaurantsOrderBy.Name).To <RegularUserFavouriteViewModel>().ToList(); var model = new UserFavouritesViewModel { OrderBy = RestaurantsOrderBy.Name, Restaurants = restaurants }; return(this.View(model)); }
public ActionResult Index(UserFavouritesViewModel model) { var userId = this.User.Identity.GetUserId(); if (model.Search == null) { model.Search = string.Empty; } var restaurants = this.users.GetFavourites(userId, model.Search, (int)model.OrderBy).To<RegularUserFavouriteViewModel>().ToList(); model.Restaurants = restaurants; return this.View(model); }
public ActionResult Index(UserFavouritesViewModel model) { var userId = this.User.Identity.GetUserId(); if (model.Search == null) { model.Search = string.Empty; } var restaurants = this.users.GetFavouriteRestaurants(userId, model.Search, model.OrderBy).To <RegularUserFavouriteViewModel>().ToList(); model.Restaurants = restaurants; return(this.View(model)); }