Giter Site home page Giter Site logo

castle.monorail.routing's Introduction

1. What is Castle.MonoRail.Routing

Castle.Monorail.Routing was developed to provide a better routing system to Castle.MonoRail.
The System.Web.Routing namespace is integrated into MonoRail, with some extension methods
to provide nice resourceful URLs.

2. Example

// In Global.asax.cs
var routes = new RouteCollection();
routes.MapResource("patients");
routes.MapResources("labs", "patients/{mrn}");

The code above maps the standard RESTful routes for the following resources.
* A list of patients (/patients)
* A patient (/patients/123)
* A patient edit form (/patients/123/edit)
* A patients creation form (/patients/123/new)

HTTP verbs are leveraged to map those resources to the following actions
on the PatientsController:
* Index (GET /patients)
* Create (POST /patients)
* Show (GET /patients/123)
* Update (PUT /patients/123, or POST /patients/123?method=put)
* Destroy (DELETE /patients/123, or POST /patients/123?method=delete)
* Edit (GET /patients/123/edit)
* New (GET /patients/123/new)

For nested resources (for example, labs which are tied to a patient), set
the resourcePrefix to the parent resource(s).  For example, a resourcePrefix
of "patients/{mrn}" and a resourceName of "labs" will create the following
URL for a list of labs: /patients/123/labs (with the mrn parameter set to 123)

castle.monorail.routing's People

Contributors

bbyars avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

qinfengzhu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.