Ejemplo n.º 1
0
        private SearchableUintraActivity Map(Event @event)
        {
            var searchableActivity = @event.Map <SearchableUintraActivity>();

            searchableActivity.Url          = _linkService.GetLinks(@event.Id).Details;
            searchableActivity.UserTagNames = _userTagService.Get(@event.Id).Select(t => t.Text);
            return(searchableActivity);
        }
        public IEnumerable <UserTagBackofficeViewModel> GetAll(int pageId)
        {
            var content = _umbracoHelper.TypedContent(pageId);

            var allTags = _userTagProvider.GetAll();

            var selectedTagsDictionary = _userTagService
                                         .Get(content.GetKey())
                                         .ToDictionary(tag => tag.Id);

            var result = allTags.Select(tag => new UserTagBackofficeViewModel
            {
                Id       = tag.Id,
                Text     = tag.Text,
                Selected = selectedTagsDictionary.ContainsKey(tag.Id)
            });

            return(result);
        }