Esempio n. 1
0
        public async Task <IActionResult> Index()
        {
            var ownerId       = GetOwnerId();
            var photoEntities = await photosRepository.GetPhotosAsync(ownerId);

            var photos = mapper.Map <IEnumerable <Photo> >(photoEntities);

            var model = new PhotoIndexModel(photos.ToList());

            return(View(model));
        }
Esempio n. 2
0
        public IActionResult Index()
        {
            var imageList = _photoService.GetAll();
            var model     = new PhotoIndexModel()
            {
                Images      = imageList,
                SearchQuery = ""
            };

            return(View(model));
        }
Esempio n. 3
0
        public async Task <IActionResult> Index(long propertyId)
        {
            var property = await _propertyRepository.GetAsync(propertyId);

            if (property == null)
            {
                return(NotFound());
            }

            var items = await _photoService.ListAsync(propertyId);

            var model = new PhotoIndexModel()
            {
                PropertyId = propertyId,
                StorageUri = _photoService.GetStorageUri(),
                Photos     = _mapper.Map <IEnumerable <PhotoModel> >(items)
            };

            return(View(model));
        }