mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-15 23:37:44 +08:00
Changing IRoutablePathConstraint from slug methods to path methods
--HG-- branch : dev
This commit is contained in:
parent
379e9a60e8
commit
1b39eb3bc0
@ -3,9 +3,9 @@ using System.Web.Routing;
|
|||||||
|
|
||||||
namespace Orchard.Core.Routable {
|
namespace Orchard.Core.Routable {
|
||||||
public interface IRoutablePathConstraint : IRouteConstraint, ISingletonDependency {
|
public interface IRoutablePathConstraint : IRouteConstraint, ISingletonDependency {
|
||||||
void SetSlugs(IEnumerable<string> slugs);
|
void SetPaths(IEnumerable<string> paths);
|
||||||
string FindSlug(string slug);
|
string FindPath(string path);
|
||||||
void AddSlug(string slug);
|
void AddPath(string path);
|
||||||
void RemoveSlug(string slug);
|
void RemovePath(string path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,15 +37,15 @@ namespace Orchard.Core.Routable.Services {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddSlug(string slug) {
|
public void AddPath(string path) {
|
||||||
lock (_syncLock) {
|
lock (_syncLock) {
|
||||||
_paths[slug] = slug;
|
_paths[path] = path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveSlug(string slug) {
|
public void RemovePath(string path) {
|
||||||
lock (_syncLock) {
|
lock (_syncLock) {
|
||||||
_paths.Remove(slug);
|
_paths.Remove(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace Orchard.Core.Routable.Services {
|
|||||||
private void Refresh() {
|
private void Refresh() {
|
||||||
var slugs = _repository.Fetch(r => r.ContentItemVersionRecord.Published && r.Path != "" && r.Path != null).Select(r => r.Path);
|
var slugs = _repository.Fetch(r => r.ContentItemVersionRecord.Published && r.Path != "" && r.Path != null).Select(r => r.Path);
|
||||||
|
|
||||||
_pageSlugConstraint.SetSlugs(slugs);
|
_pageSlugConstraint.SetPaths(slugs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user