Наследование: Orchard.ContentManagement.Records.ContentPartRecord
Пример #1
0
 private void UntagContentItem(TagsPartRecord tagsPartRecord, string tagName)
 {
     var tagPart = _orchardServices.ContentManager.Get<TagsPart>(tagsPartRecord.Id, VersionOptions.Latest);
     tagPart.CurrentTags = tagPart.CurrentTags.Where(x => x != tagName);
 }
 private void TagContentItem(TagsPartRecord tagsPartRecord, string tagName) {
     var tagRecord = GetTagByName(tagName);
     var tagsContentItems = new ContentTagRecord { TagsPartRecord = tagsPartRecord, TagRecord = tagRecord };
     _contentTagRepository.Create(tagsContentItems);
 }
Пример #3
0
 private void TagContentItem(TagsPartRecord tagsPartRecord, string tagName)
 {
     var tagPart = _orchardServices.ContentManager.Get<TagsPart>(tagsPartRecord.Id, VersionOptions.Latest);
     tagPart.CurrentTags = tagPart.CurrentTags.Concat(new [] {tagName});
     var tagRecord = GetTagByName(tagName);
     var tagsContentItems = new ContentTagRecord { TagsPartRecord = tagsPartRecord, TagRecord = tagRecord };
     _contentTagRepository.Create(tagsContentItems);
 }