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)); }
public IActionResult Index() { var imageList = _photoService.GetAll(); var model = new PhotoIndexModel() { Images = imageList, SearchQuery = "" }; return(View(model)); }
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)); }