mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
@@ -49,6 +49,10 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
||||
@@ -19,17 +19,20 @@ namespace Orchard.Tags.Services {
|
||||
private readonly INotifier _notifier;
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
private readonly IOrchardServices _orchardServices;
|
||||
private readonly ISessionFactoryHolder _sessionFactoryHolder;
|
||||
|
||||
public TagService(IRepository<TagRecord> tagRepository,
|
||||
IRepository<ContentTagRecord> contentTagRepository,
|
||||
INotifier notifier,
|
||||
IAuthorizationService authorizationService,
|
||||
IOrchardServices orchardServices) {
|
||||
IOrchardServices orchardServices,
|
||||
ISessionFactoryHolder sessionFactoryHolder) {
|
||||
_tagRepository = tagRepository;
|
||||
_contentTagRepository = contentTagRepository;
|
||||
_notifier = notifier;
|
||||
_authorizationService = authorizationService;
|
||||
_orchardServices = orchardServices;
|
||||
_sessionFactoryHolder = sessionFactoryHolder;
|
||||
Logger = NullLogger.Instance;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
@@ -207,6 +210,11 @@ namespace Orchard.Tags.Services {
|
||||
}
|
||||
|
||||
contentItem.As<TagsPart>().CurrentTags = tagNamesForContentItem;
|
||||
|
||||
var sessionFactory = _sessionFactoryHolder.GetSessionFactory();
|
||||
|
||||
if (sessionFactory != null)
|
||||
sessionFactory.EvictCollection("Orchard.Tags.Models.TagsPartRecord.Tags", contentItem.As<TagsPart>().Record.Id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user