diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj index 737ef18fc..37eb0d8ae 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj @@ -148,6 +148,10 @@ {9916839C-39FC-4CEB-A5AF-89CA7E87119F} Orchard.Core + + {66fccd76-2761-47e3-8d11-b45d0001ddaa} + Orchard.Autoroute + {f301ef7d-f19c-4d83-aa94-cb64f29c037d} Orchard.ContentPicker diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs index 4bfc517b0..6bc664967 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using JetBrains.Annotations; +using Orchard.Autoroute.Models; using Orchard.Blogs.Models; using Orchard.Blogs.Routing; using Orchard.ContentManagement; @@ -19,7 +20,7 @@ namespace Orchard.Blogs.Services { } public BlogPart Get(string path) { - return _contentManager.Query().List().FirstOrDefault(rr => rr.As().Path == path); + return _contentManager.Query().Where(r => r.DisplayAlias == path).ForPart().Slice(0, 1).FirstOrDefault(); } public ContentItem Get(int id, VersionOptions versionOptions) {