Exemplo n.º 1
0
        /// <summary>
        /// Get single dog with all active/non-deleted dog album images
        /// </summary>
        /// <param name="id">Dog Id <see cref="int"/></param>
        /// <returns><see cref="DogAlbumImages"/> object for single dog</returns>
        public async Task <DogAlbumImages> GetDogAlbumImages(int id)
        {
            // get dog entity with active/non-deleted album images
            Dogs dog = await _dogRepository.FindDogWithAlbumImagesById(id);

            return(new DogAlbumImages()
            {
                DogId = dog.Id,
                DogName = dog.Name,
                Images = _mapper.Map <List <AlbumImage> >(dog.AlbumImages)
            });
        }