Preliminary performance optimizations

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2011-12-20 18:16:39 -08:00
parent 47c102c913
commit 573fd2c902
13 changed files with 141 additions and 30 deletions

View File

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

View File

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

View File

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