public ActionResult GetAlbumsByUserId([FromRoute] int userId)
        {
            IEnumerable <AlbumEntity> albumEntities = albumsService.GetAlbumsByUserId(userId);
            IEnumerable <AlbumModel>  albums        = mapper.Map <IEnumerable <AlbumModel> >(albumEntities);

            return(View(albums));
        }
Exemplo n.º 2
0
 public async Task <List <Album> > Get(int userId)
 {
     if (userId == 0)
     {
         return(await _albumsService.GetAlbums());
     }
     else
     {
         return(await _albumsService.GetAlbumsByUserId(userId));
     }
 }