Skip to content
mauricioaniche edited this page Sep 14, 2010 · 9 revisions

Installing

The installation process is very simple!

1. Download the latest Restfulie version from Downloads page
2. Reference all .dlls (restfulie.server.dll and castle dlls) in your ASP.NET MVC2 project

And you are good to go!

Writing the first controller

1. Annotate your controller with ActAsRestfulie;
2. Use some Restfulie result as a response from your action.

[ActAsRestfulie]
public class ItemsController : Controller
{
    // somehow injected
    private Repository repository;

    public virtual ActionResult Index()
    {
        return new OK(repository.List());
    }
}

In the example above, Restfulie will return a 200 HTTP OK with a serialized list of resources in the specified media type. Read more from results and media types in their specific wiki pages.

Important: DO NOT forget to make your action methods virtual.

Clone this wiki locally