예제 #1
0
        //Photos/AllPhotos
        public IActionResult AllPhotos()
        {
            //get the model
            List <Photo> photos = repository.GetPhotos();

            //return the view with the model in it
            return(View(photos));
        }
예제 #2
0
        public void OnGet()
        {
            //get the model
            List <Photo> photos = repository.GetPhotos();

            //return the view with the model in it
            Photos = photos;
        }
예제 #3
0
        public List <Photos> GetPhotos()
        {
            MySqlConnection connection = connectionFactory.ConnectionCar;

            try
            {
                return(photosRepository.GetPhotos(connection));
            }
            catch (Exception e)
            {
                connection.CancelQuery(100);
                throw e;
            }
        }
예제 #4
0
        public async Task <IEnumerable <PhotoResource> > GetPhotos(int vehicleId)
        {
            var photos = await photosRepository.GetPhotos(vehicleId);

            return(mapper.Map <IEnumerable <Photo>, IEnumerable <PhotoResource> >(photos));
        }