Hi Adriano,

To run some code at controller creation you can override the Initialize method 
of Controller:
public override void Initialize() { }

To run something at the end you probably need to override Dispose method of 
Controller:
public virtual void Dispose() { 
    
    //Your code goes here 
    
    base.Dispose(); //Make sure you call the base Dispose! 

}

Hope this helps.

Cheers
John




________________________________
From: Adriano Ribeiro <[email protected]>
To: Castle Project Users <[email protected]>
Sent: Tue, 31 August, 2010 12:17:16 AM
Subject: Re: RESTful capable controller

Hi, John,

Thankfull for answer, i already know Openrasta, but i really would
like to use just pure Monorails. I taking look on
DefaultControllerFactory i will try with this.

again, thaks for answer.

On 29 ago, 00:23, John Simons <[email protected]> wrote:
> Hi Adriano,
>
> Maybe u should consider using OpenRasta instead 
>-http://trac.caffeine-it.com/openrasta
>
> Cheers, John
>
> On 29/08/2010, at 0:00, Adriano Ribeiro <[email protected]> wrote:
>
> > Hi,
>
> > I saw fill implementations of rest with monorails but i don´t of their
> > style, so i making my own, but my version need be easy to use,
> > flexible. to acomplish this requiriments i will base in same concept
> > of this controllers SmartDispatcherController or
> > ARSmartDispatcherController.  and i implementing restful route
> > semantic on top of SmartDispatcherController.
>
> > My idea is have some like this in the end:
>
> > MyResourcesController: RESTfulController
> > {
>
> >     void FiredWhenControllerRegistredOnMonorails()
> >     {
> >            AddResourceRoute("/v1/MyResources",Verb.Get, ListAll);
> >            AddResourceRoute("/v1/MyResources/filter",Verb.Get,
> > ListFiltered);
> >            AddResourceRoute("/v1/MyResources/id",Verb.Get, GetOne);
> >            AddResourceRoute("/v1/MyResources/",Verb.Post, Edit);
> >            AddResourceRoute("/v1/MyResources/",Verb.Put, Update);
> >            AddResourceRoute("/v1/MyResources/",Verb.Delete, Delete);
> >     }
>
> >     void FiredwhenControllerUnRegistredOnMonorails()
> >     {
> >            DeleteResourceRoute("/v1/MyResources",Verb.Get, ListAll);
> >            DeleteResourceRoute("/v1/MyResources/filter",Verb.Get,
> > ListFiltered);
> >            DeleteResourceRoute("/v1/MyResources/id",Verb.Get,
> > GetOne);
> >            DeleteResourceRoute("/v1/MyResources/",Verb.Post, Edit);
> >            DeleteResourceRoute("/v1/MyResources/",Verb.Put, Update);
> >            DeleteResourceRoute("/v1/MyResources/",Verb.Delete,
> > Delete);
> >     }
> > }
>
> > I didn´t found a place to register this route when Controller been
> > registred and removed when controller was removed.
>
> > I would like to control add and remove restful controller at runtime.
>
> > I was clear enogh.
>
> > thankfull for any help
>
> > --
> > 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 
>athttp://groups.google.com/group/castle-project-users?hl=en.

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


      

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