Changing IRoutablePathConstraint from slug methods to path methods

--HG--
branch : dev
This commit is contained in:
Louis DeJardin 2010-06-08 12:01:00 -07:00
parent 379e9a60e8
commit 1b39eb3bc0
3 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

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