Coder Social home page Coder Social logo

wzugang / restful-routing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from restful-routing/restful-routing

0.0 2.0 0.0 6.95 MB

A rails inspired restful routing api for asp .net mvc

Home Page: http://restfulrouting.com

License: MIT License

Ruby 0.52% Pascal 0.49% CSS 1.82% C# 72.52% ASP 0.03% JavaScript 24.61%

restful-routing's Introduction

Restful Routing for ASP .NET MVC

Inspired by the rails routing api.

Available via NuGet.

 PM> Install-Package RestfulRouting 

Checkout out the new documentation site included in this project, which can be found hosted at restfulrouting.com. If you find any improvements that need to be made, please feel free to contact us or send a pull request.

Basic usage:

public class Routes : RouteSet
{
	public override void Map(Mapper map)
	{
		map.Root<HomeController>(x => x.Show());
		map.Path("test/{id}").To<TestController>(x => x.Test()).Constrain("id", @"\d+");
		map.Resource<SessionsController>();
		map.Resources<BlogsController>(blogs =>
		{
			blogs.As("weblogs");
			blogs.Only("index", "show");
			blogs.Collection(x => {
				x.Get("latest");
				x.Post("someaction");
			);
			blogs.Member(x => x.Put("move"));

			blogs.Resources<PostsController>(posts =>
			{
				posts.Except("create", "update", "destroy");
				posts.Resources<CommentsController>(c => c.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

Written by Steve Hodgkiss with contributions from

Latest Release

1.5.0

  • Add support for customizing the name of the resource id parameter. Thanks Dan Malcolm.

1.4.6

  • Fixed a minor issue with resource names when in an area, not sure if anybody uses resource names but it was bugging me. Also nested Roots now reflect their origin. ex. root, area_root, area_nested_root.

1.4.5

  • long overdue helpful exception message. Everyone rejoice and no longer be confused.

1.4.4

  • allow you to nest Areas now properly, thanks again to Adrian Phinney.

1.4.3

  • fix for Area Mapper prefix. Thanks to Adrian Phinney.

1.4.0

  • added new DSL to allow you to redirect dead links, to newer urls.

1.3.5

  • added the ability to ReRoute inside a Resource mapping. Thanks to David Alpert.

1.3.4

  • added the ability to see non Restful Routing (RouteBase) routes in routedebugger, helpful for seeing things like the order of routes. Helped me debug an issue with SignalR.

1.3.3

  • added “staff” to inflector. Thanks Nathan Wood.

1.3.2

  • All routes now get namespaces, by default. This will save a lot of headaches, and the ability to reuse controller names not in the same namespace.

1.3.1

  • Switched route debugger over to use Twitter Bootsrap from CDN sources
  • Merged in namespace additions from woodnathan

1.3.0

  • Removed dependency on RazorEngine so we can start moving to ASP.Net MVC 4.

1.2.3

  • Fixed float parsing on systems with decimal separator other than “.” (thanks irium)

1.2.2

  • Fixes ordering issue with Only (thanks Tommysqueak)
  • Fixes StandardMapper to use RestfulHttpMethodConstraint (thanks Tommysqueak)
  • Fixed version number on dll to match version number of Restful Routing

1.2.0

  • Addition of ExposeResult in FormatResult (thanks SlyNet)

1.1.3

  • New Route Debugger (uses datatables for filtering)
  • Mono Fixes (thanks cdroulers)
  • Released version to Nuget

restful-routing's People

Contributors

stevehodgkiss avatar khalidabuhakmeh avatar tt avatar slynet avatar cdroulers avatar thecloudlesssky avatar corydeppen avatar mbp avatar exalted avatar ayoung avatar danmalcolm avatar davidalpert avatar ro31337 avatar defeated avatar woodnathan avatar

Watchers

James Cloos avatar 江湖隐行客 avatar

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.