public IHttpActionResult Get(int id) { var photoAlbum = _photoAlbumService.GetById(id); if (photoAlbum == null) { return(NotFound()); } photoAlbum.Views++; _photoAlbumService.SavePhotoAlbum(); var photoAlbumViewModel = Mapper.Map <PhotoAlbum, PhotoAlbumWithImagesViewModel>(photoAlbum); return(Ok(photoAlbumViewModel)); }