Blog.Logic.Core.AlbumLogic.GetByUser C# (CSharp) Method

GetByUser() public method

public GetByUser ( int userId ) : List
userId int
return List
        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;
        }