mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Preliminary performance optimizations
--HG-- branch : 1.x
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Orchard.Core.Navigation.Services {
|
||||
public string MenuName { get { return "main"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
var menuParts = _contentManager.Query<MenuPart, MenuPartRecord>().Where(x => x.OnMainMenu).List();
|
||||
var menuParts = _contentManager.Query<MenuPart, MenuPartRecord>().Where(x => x.OnMainMenu).WithQueryHints(new QueryHints().ExpandRecords<MenuItemPartRecord>()).List();
|
||||
foreach (var menuPart in menuParts) {
|
||||
if (menuPart != null) {
|
||||
var part = menuPart;
|
||||
|
@@ -42,7 +42,7 @@ namespace Orchard.Core.Routable.Services {
|
||||
}
|
||||
|
||||
public ActionResult GetHomePage(int id) {
|
||||
var contentItem = _contentManager.Get(id, VersionOptions.Published);
|
||||
var contentItem = _contentManager.Get(id, VersionOptions.Published, new QueryHints().ExpandRecords<RoutePartRecord>());
|
||||
if (contentItem == null || !contentItem.Is<RoutePart>())
|
||||
return new HttpNotFoundResult();
|
||||
|
||||
|
@@ -42,7 +42,7 @@ namespace Orchard.Core.Settings.Services {
|
||||
return site.Id;
|
||||
});
|
||||
|
||||
return _contentManager.Get<ISite>(siteId);
|
||||
return _contentManager.Get<ISite>(siteId, VersionOptions.Published, new QueryHints().ExpandRecords<SiteSettingsPartRecord>());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user