A rails inspired restful routing api for asp .net mvc
C# ASP
Pull request Compare This branch is 206 commits behind restful-routing:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/aspnetmvc2
src
tools
.gitignore
MIT-LICENSE.txt
README.textile
Rakefile

README.textile

Restful Routing for ASP .NET MVC

Inspired by the rails routing api.

public class Routes : RouteSet
{
  public Routes()
  {
    Resource<SessionsController>();
    Resources<BlogsController>(() =>
    {
      As("weblogs");
      Only("index", "show");
      Collection(x => {
	    x.Get("latest");
		x.Post("someaction");
	  );

      Resources<PostsController>(() =>
      {
        Except("create", "update", "destroy");
        Resources<CommentsController>(() => Except("destroy"));
      });
    });
  }
}

public class MvcApplication : System.Web.HttpApplication
{
  protected void Application_Start()
  {
    ViewEngines.Engines.Clear();
    ViewEngines.Engines.Add(new RestfulRoutingViewEngine());
    
    RouteTable.Routes.MapRoutes<Routes>();
    }
}

Read more

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don’t break it in a
    future version unintentionally.
  • Send me a pull request. Bonus points for topic branches.

Contributors