public ActionResult AdvancedSearch(Photo searchModel) { string userId = User.Identity.GetUserId(); ListOfPhotosDto photos = _photoService.Search(searchModel, userId); return(View("Index", photos)); }
public ActionResult Search(string name) { string userId = User.Identity.GetUserId(); ListOfPhotosDto photos = _photoService.SearchByName(name, userId); return(View("Index", photos)); }
public ListOfPhotosDto SearchByName(string photoName, string userId) { List <Photo> photos = _unitOfWork.Photos.SearchByName(photoName, userId).ToList(); List <PhotoDto> photoDtos = PreparePhotoDtoList(userId, photos); ListOfPhotosDto listOfPhotosDto = new ListOfPhotosDto { CanBeChanged = true, PhotoDtoList = photoDtos }; return(listOfPhotosDto); }
public ListOfPhotosDto GetPhotoDtosOfTheUser(string userId) { List <Photo> photos = _unitOfWork.Photos.GetPhotosByUserId(userId).ToList(); List <PhotoDto> photoDtos = PreparePhotoDtoList(userId, photos); ListOfPhotosDto listOfPhotosDto = new ListOfPhotosDto { CanBeChanged = true, PhotoDtoList = photoDtos }; return(listOfPhotosDto); }