public List<Album> GetByUser(int userId)
{
var albums = new List<Album>();
try
{
var db = _albumRepository.Find(a => a.UserId == userId, true).ToList();
db.ForEach(a => albums.Add(AlbumMapper.ToDto(a)));
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
return albums;
}