mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Reuse Settings_ShellDescriptorRecord during an http request (#8355)
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Orchard.Core.Settings.Descriptor {
|
||||
private readonly IRepository<ShellDescriptorRecord> _shellDescriptorRepository;
|
||||
private readonly IShellDescriptorManagerEventHandler _events;
|
||||
private readonly ShellSettings _shellSettings;
|
||||
|
||||
private ShellDescriptorRecord _shellDescriptorRecord;
|
||||
public ShellDescriptorManager(
|
||||
IRepository<ShellDescriptorRecord> shellDescriptorRepository,
|
||||
IShellDescriptorManagerEventHandler events,
|
||||
@@ -51,7 +51,10 @@ namespace Orchard.Core.Settings.Descriptor {
|
||||
}
|
||||
|
||||
private ShellDescriptorRecord GetDescriptorRecord() {
|
||||
return _shellDescriptorRepository.Get(x => x != null);
|
||||
if (_shellDescriptorRecord == null) {
|
||||
_shellDescriptorRecord = _shellDescriptorRepository.Get(x => x != null);
|
||||
}
|
||||
return _shellDescriptorRecord;
|
||||
}
|
||||
|
||||
public void UpdateShellDescriptor(int priorSerialNumber, IEnumerable<ShellFeature> enabledFeatures, IEnumerable<ShellParameter> parameters) {
|
||||
|
||||
Reference in New Issue
Block a user