Interesting, I didn't see it that way. I can now see some use for it :) Are you going to restrict the Verb combination? Eg. .RestrictTo(Verbs.Post | Verbs.Get); -> Doesn't make sense!
John On Jul 2, 6:23 pm, Ken Egozi <[email protected]> wrote: > you won't always have the same name (maybe not even the same controller). > consider the list/add/ (GET/POST/) RESTful urls on resource roots > > /my/resource => Get wil goo to List(), POST to Add() (that might be on an > Admin Controller) > my/resource/1 => GET goes to Get(), DELETE goes to Remove() (that might be > on an Admin Controller) > > anyhoo, I think I'll through this in. no breaking changes and all. I > thought more people would have found it useful and have input on the > suggested API (I started with .With(Verb) but Restrict is more in-line with > the Routing API > > On Thu, Jul 2, 2009 at 1:51 AM, John Simons <[email protected]>wrote: > > > > > > > You can have 2 methods with AccessibleThrough attribute. > > Eg. > > > [AccessibleThrough(Verb.Get)] > > public void AddGroups() > > > [AccessibleThrough(Verb.Post)] > > public void AddGroups(List<string> groups) > > > The first method will respond to gets and the second will respond to > > posts. > > > John > > > On Jul 1, 10:48 pm, Ken Egozi <[email protected]> wrote: > > > same url points to two different methods. => two routes. > > > > On Wed, Jul 1, 2009 at 3:45 PM, Jonathon Rossi <[email protected]> > > wrote: > > > > I wouldn't have thought that the http method had anything to do with > > > > routing. > > > > > What is wrong with the AccessibleThrough attribute since only the > > > > controller really knows how you should use it, or did I miss the > > important > > > > point? > > > > > On Wed, Jul 1, 2009 at 10:35 PM, Ken Egozi <[email protected]> wrote: > > > > >> do you think it's useful? do you have another way to achieve this? > > > > >> eg.: > > > > >> var barsListRoute = new PatternRoute("BarsList", "/bars") > > .DefaultForController.Is("bars") > > > >> .DefaultForAction.Is("list") > > > >> .RestrictTo(Verbs.Get | Verbs.Head); > > > > >> var newBarRoute = new PatternRoute("NewBar", "/bars") > > .DefaultForController.Is("bars") > > > >> .DefaultForAction.Is("new") > > > >> .RestrictTo(Verbs.Post); > > > > >> var barRoute = new PatternRoute("Bar", "/bars/<barId>") > > .DefaultForController.Is("bars") > > > >> .DefaultForAction.Is("show") > > > >> .RestrictTo(Verbs.Get | Verbs.Head); > > > > >> var updateBarRoute = new PatternRoute("UpdateBar", "/bars/<barId>") > > > >> .DefaultForController.Is("bars") > > > >> .DefaultForAction.Is("update") > > > >> .RestrictTo(Verbs.Put); > > > > >> I have an implementation ready. waiting for input. > > > > >> -- > > > >> Ken Egozi. > > > >>http://www.kenegozi.com/blog > > > >>http://www.delver.com > > > >>http://www.musicglue.com > > > >>http://www.castleproject.org > > > >>http://www.gotfriends.co.il > > > > > -- > > > > Jono > > > > -- > > > Ken Egozi. > >http://www.kenegozi.com/bloghttp://www.delver.comhttp://www.musicglue... > > -- > Ken > Egozi.http://www.kenegozi.com/bloghttp://www.delver.comhttp://www.musicglue.comhttp://www.castleproject.orghttp://www.gotfriends.co.il --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
