コード例 #1
0
        /// <summary>
        /// Возвращает список моделей медиа
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public IEnumerable <EntityCollection <PersonMediaModel> > GetMedia(int id)
        {
            var list = PersonModelHelper.GetMediaModels(_personRepository.GetMedia(id));

            foreach (var item in list)
            {
                item.LastChange = LogModelHelper.GetLastChangeModel(_logRepository.GetLastChangePersonMedia(item.id_Person, item.Id));
                item.Tags       = TagModelHelper.GeTagModels(_tagRepository.GetPersonMediaTags(item.Id));
                item.Links      = new LinksModel
                {
                    PersonLinks = PersonModelHelper.GetPersonModels(_personRepository.GetMediaPersonLinks(item.Id)),
                    EventLinks  = EventModelHelper.GetEventModels(_personRepository.GetMediaEventLinks(item.Id))
                };
            }
            var types = list.GroupBy(o => o.id_MediaType).Select(o => o.Key);

            return(types.Select(tp => new EntityCollection <PersonMediaModel> {
                List = list.Where(o => o.id_MediaType == tp), Type = tp
            }));
        }
コード例 #2
0
        /// <see cref="ITagService.GetPersonMediaTags"/>
        public IList <TagModel> GetPersonMediaTags(int mediaId)
        {
            var result = _tagRepository.GetPersonMediaTags(mediaId);

            return(TagModelHelper.GeTagModels(result));
        }
コード例 #3
0
        /// <see cref="ITagService.GetAntroTags"/>
        public IList <TagModel> GetAntroTags(int tagAntroId)
        {
            var result = _tagRepository.GetAntroTags(tagAntroId);

            return(TagModelHelper.GeTagModels(result));
        }
コード例 #4
0
        /// <see cref="ITagService.GetDescriptionTags"/>
        public IList <TagModel> GetDescriptionTags(int descriptionId)
        {
            var result = _tagRepository.GetDescriptionTags(descriptionId);

            return(TagModelHelper.GeTagModels(result));
        }
コード例 #5
0
        /// <see cref="ITagService.GetTags"/>
        public IList <TagModel> GetTags()
        {
            var result = _tagRepository.GetTags();

            return(TagModelHelper.GeTagModels(result));
        }
コード例 #6
0
        /// <see cref="ITagService.GetEventTags"/>
        public IList <TagEventModel> GetEventTags(int eventId)
        {
            var result = _tagRepository.GetEventTags(eventId);

            return(TagModelHelper.GeTagModels(result));
        }