/// <summary> /// CREATE FAVORITE section /// </summary> /// <returns>Photo list view</returns> public async Task <IActionResult> Favorites() { List <Photos> PhotoList = new List <Photos>(); AccountUser user = await GetLoggedInUser(); PhotoList = photoRepository.GetAllFavPhotosByUserId(user.Id); return(View(PhotoList)); }
public async Task <IViewComponentResult> InvokeAsync() { List <Photos> PhotoList = new List <Photos>(); AccountUser user = await UserManager.GetLoginAcccountUser(UserClaimsPrincipal); PhotoList = photoRepository.GetAllFavPhotosByUserId(user.Id); return(View("~/Views/Shared/_Fav.cshtml", PhotoList)); }