Commit Graph

6 Commits

Author SHA1 Message Date
Ryan Nowak 813171a016 Reduce allocation in URL generation
This change optimizes our a per-operation dictionary that really can just
be cached for the whole app's lifetime.
2015-12-18 09:20:52 -08:00
Pranav K 2ab24aa0f4 Remove custom url encoding
Fixes #214
2015-12-16 09:06:49 -08:00
Ryan Nowak 604fc6bb54 Fix #248 Add HttpMethodRouteConstraint
Constraint code ported from WebAPI2. Tests are new.

Also a bunch of misc cleanup for constraints.
- Move IRouteConstraint to abstractions
- Fix namespace of a constraint
- Some general style cleanup
- use RouteValueDictionary in the public API
2015-12-14 08:52:47 -08:00
Ryan Nowak 36180ab6d0 Add IRouteHandler, RouteBase, and IRoutingFeature
Adds IRouterHandler, an abstraction for endpoints in the routing system
that can't chain (example: delegates). The idea is that some kinds of
routes aren't really friendly to chaining. If you don't support chaining,
then accept IRouteHandler and work with that rather than IRouter.

There's one implementation of IRouteHandler, RouteHandler. It implements
both IRouter and IRouteHandler.

Adds RouteBase as a base class for routes based on our template syntax and
defaults/constraints/data-tokens. Updated a lot of signatures to be
get/set virtual and mutable to facilitate or bigger variety of usage
scenarios.

Renamed TemplateRoute to just Route, now inherits from RouteBase.

Adds IRoutingFeature for middleware scenarios where you don't have access
to the route context.

Also adds some basic extension methods for accessing route values.
2015-12-10 17:55:03 -08:00
Ryan Nowak b01183f023 Simplify link generation code
- Removes ProvidedValues and IsBound

- Removes best-effort link generation

- simplify code where possible

- lots of test simplification
2015-12-07 11:04:19 -08:00
Ryan Nowak 4441fba4ee Clean up folders and test names 2015-11-30 09:36:07 -08:00