public IActionResult Index() { var plants = plantService.GetAllPlantsOfUser(User.Identity.Name); IEnumerable <MyPlantsPlantCardViewModel> plantCards = plants.Select(x => new MyPlantsPlantCardViewModel() { Id = x.Id, Name = x.Name, WateringPeriod = x.WateringPeriod }); MyPlantsViewModel mpvw = new MyPlantsViewModel() { plantCards = plantCards }; return(View(mpvw)); }