Deleting useless code

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-11-25 17:25:20 -08:00
parent bea037b31a
commit 51c03b08f5
2 changed files with 2 additions and 18 deletions

View File

@@ -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();

View File

@@ -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); } }
}
}