mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-15 13:53:34 +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 {
|
||||
public interface IRoutablePathConstraint : IRouteConstraint, ISingletonDependency {
|
||||
void SetSlugs(IEnumerable<string> slugs);
|
||||
string FindSlug(string slug);
|
||||
void AddSlug(string slug);
|
||||
void RemoveSlug(string slug);
|
||||
void SetPaths(IEnumerable<string> paths);
|
||||
string FindPath(string path);
|
||||
void AddPath(string path);
|
||||
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) {
|
||||
_paths[slug] = slug;
|
||||
_paths[path] = path;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveSlug(string slug) {
|
||||
public void RemovePath(string path) {
|
||||
lock (_syncLock) {
|
||||
_paths.Remove(slug);
|
||||
_paths.Remove(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace Orchard.Core.Routable.Services {
|
||||
private void Refresh() {
|
||||
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