mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Deleting useless code
--HG-- branch : dev
This commit is contained in:
@@ -12,16 +12,6 @@ namespace Orchard.Tags.Handlers {
|
||||
public TagsPartHandler(IRepository<TagsPartRecord> repository, IRepository<TagRecord> tagsRepository, IRepository<ContentTagRecord> tagsContentItemsRepository) {
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
|
||||
OnLoading<TagsPart>((context, tags) => {
|
||||
// populate list of attached tags on demand
|
||||
tags._currentTags.Loader(list => {
|
||||
foreach(var tag in tagsContentItemsRepository.Fetch(x => x.TagsPartRecord.Id == context.ContentItem.Id))
|
||||
list.Add(tag.TagRecord);
|
||||
return list;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
OnRemoved<TagsPart>((context, tags) => {
|
||||
tagsContentItemsRepository.Flush();
|
||||
|
||||
|
@@ -1,15 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Utilities;
|
||||
|
||||
namespace Orchard.Tags.Models {
|
||||
public class TagsPart : ContentPart<TagsPartRecord> {
|
||||
public TagsPart() {
|
||||
CurrentTags = new List<TagRecord>();
|
||||
}
|
||||
|
||||
public readonly LazyField<IList<TagRecord>> _currentTags = new LazyField<IList<TagRecord>>();
|
||||
|
||||
public IList<TagRecord> CurrentTags { get { return _currentTags.Value; } set { _currentTags.Value = value; } }
|
||||
public IEnumerable<TagRecord> CurrentTags { get { return Record.Tags.Select(t => t.TagRecord); } }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user