public override IEnumerable <MyLinkItemModel> GetMenu() { var links = _myLinksService .GetMany(_intranetMemberService.GetCurrentMember().Id) .OrderByDescending(link => link.CreatedDate) .ToList(); var contents = _umbracoHelper.TypedContent(links.Select(el => el.ContentId)); var models = links.Join(contents, link => link.ContentId, content => content.Id, (link, content) => new MyLinkItemModel { Id = link.Id, Name = link.ActivityId.HasValue ? GetLinkName(link.ActivityId.Value) : GetNavigationName(content), Url = GetUrl(link, content) }); return(models.Distinct(_myLinkItemModelComparer)); }
public IEnumerable <MyLinkItemModel> GetMenu() { var links = _myLinksService .GetMany(_intranetMemberService.GetCurrentMember().Id) .OrderByDescending(link => link.CreatedDate) .ToList(); var contents = _nodeModelService.GetByIds(links.Select(el => el.ContentId)); var models = links.Join(contents, link => link.ContentId, content => content.Id, (link, content) => new MyLinkItemModel { Id = link.Id, ContentId = content.Id, ActivityId = link.ActivityId, Name = link.ActivityId.HasValue ? GetLinkName(link.ActivityId.Value) : GetNavigationName(content), Url = GetUrl(link, content.Url) }); return(MapLinks(models)); }