コード例 #1
0
        public ActionResult AdvancedSearch(Photo searchModel)
        {
            string          userId = User.Identity.GetUserId();
            ListOfPhotosDto photos = _photoService.Search(searchModel, userId);

            return(View("Index", photos));
        }
コード例 #2
0
        public ActionResult Search(string name)
        {
            string          userId = User.Identity.GetUserId();
            ListOfPhotosDto photos = _photoService.SearchByName(name, userId);

            return(View("Index", photos));
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }