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

View File

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

View File

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