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.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
-~----------~----~----~----~------~----~------~--~---

Reply via email to