コード例 #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
ファイル: PhotosService.cs プロジェクト: Bosabom/IPZ_4_LB_cs
        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));
        }