public IActionResult ModifyFoodItem(string mealType) { SearchFoodVM vm = new SearchFoodVM(); User user = authProvider.GetCurrentUser(); vm.FoodList = foodDAL.GetLoggedFood(user.Id); vm.MealType = mealType; return(View(vm)); }
public IActionResult Index() { ProfileVM profile = new ProfileVM(); profile.User = authProvider.GetCurrentUser(); profile.Goal = goalDAL.GetCurrentGoal(profile.User.Id); profile.FoodList = foodDAL.GetLoggedFood(profile.User.Id); // This is how we get star count. It is called every time the user sees this page profile.User.Stars = profileDAL.GetStarCount(profile.User); return(View(profile)); }