public List<Hobby> GetByUser(int userId)
{
var hobbies = new List<Hobby>();
try
{
var db = _hobbyRepository.Find(a => a.UserId == userId, false).ToList();
db.ForEach(a => hobbies.Add(HobbyMapper.ToDto(a)));
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
return hobbies;
}