public Album GetUserDefaultGroup(int userId)
{
try
{
var db = _albumRepository.Find(a => a.IsUserDefault && a.UserId == userId, false).FirstOrDefault();
if (db != null)
{
return AlbumMapper.ToDto(db);
}
return new Album().GenerateError<Album>(
(int)Constants.Error.RecordNotFound,
string.Format("Cannot find default album for user with Id {0}", userId));
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
}