Commit Graph

55 Commits

Author SHA1 Message Date
Pranav K 29a5cb8aa9 Change the namespace for the MapRoute extension 2015-01-23 16:08:38 -08:00
Mugdha Kulkarni 3626900bc9 Basic URL Extension functionality working.
1. Template parser now allows a parameter to be an optional parameter in a complex segment if
   it is the last and only optional parameter and it is followed by a period.
2. Template matcher modified to take into consideration the optional parameter in the complex
   segment. Also the period shouldn't be present if the optional parameter is not present
2015-01-16 16:25:53 -08:00
Mugdha Kulkarni f549a550a9 Fixing the issue #123.
Added OptionalRouteConstraint class to take care of optional inline parameter. It will create the OptionalRouteConstraint for a inline parameter that is optional with real constraint on the parameter as inner constraint of OptionalRouteConstraint.
2014-12-04 10:54:27 -08:00
Hao Kung 21a6f44c38 GetDefaultServices -> AddRouting with TryAdd 2014-11-24 16:37:10 -08:00
Doug Bunting 1a101d7815 Delete trailing whitespace
- #EngineeringDay
- Total replaced: 105  Matching files: 44 in *.cs files
- Total replaced: 27  Matching files: 1 in all other files
2014-11-20 09:40:12 -08:00
Ryan Nowak 01345eca91 Fix for #92 - Make Constraints, DataTokens, and Defaults readonly
The properties on TemplateRoute for DataTokens and Defaults are now
readonly. This prevents modifying these collections in a way that
invalidates cached data, or violates thread-safety.

To do the same for constraints, this change includes a substantial refactor
of how we realize inline constraints, and moves the constraint resolver
out of the parsing phase.

This allow creates a builder for the constraint map, that will make it
easier to implement features like optional constraints, and is reusable
for anyone building their own type of routing system.
2014-11-18 11:24:25 -08:00
Ryan Nowak 87f0bbb092 adding tests 2014-10-31 16:00:04 -07:00
Ryan Nowak d78e5478a7 Fix for #65,116 - Implement 'stack of routers'
This is the routing part of the fix. MVC will be updated as well
(attribute routing).

As the graph of routers is traversed, routers add themselves to the
current 'path', which unwinds on a failed path.

This mechanism is opt-in. Whoever adds something needs to remove it as
part of cleanup. If a router in the tree doesn't interact with the
.Routers property, then there are no consequences for those that do.

Additionally, fixing #116 as part of the same change. This means that we
create a nested 'RouteData' and then restore it on the way out. This is
simpler than just dealing with the .Routers property in isolation.
2014-10-31 14:07:35 -07:00
jacalvar 02a0a218b9 [Fixes #90] RouteTemplate does not take RouteData
Changed the implementation of route template to merge the existing route data
with the values obtained from parsing the request path with the given template.

Restored original route data values in case the route template data does not match.
2014-10-22 13:22:11 -07:00
Stephen Halter fff1d62f01 Change GetService calls to GetRequiredService
GetRequiredService throws for missing services like GetService used to.
2014-10-17 15:31:57 -07:00
Hao Kung 86dcbfd0d1 React to options and hosting changes
Uses EnsureRequestServices to force RequestServices to be created
2014-10-14 19:09:15 -07:00
SonjaKhan 2a8ac595d8 Refactoring ILogger, see aspnet/Logging#3 2014-10-14 10:20:58 -07:00
jacalvar 3ff9d6e8a0 [Fixes #108] Disallow the use of '*' in route parameter names 2014-10-13 15:55:02 -07:00
David Fowler 4a8de5dad4 Updated to use the new target framework in project.json 2014-09-04 01:50:07 -07:00
harshgMSFT efdd3054d2 Adding DataTokens Support. 2014-08-11 11:59:00 -07:00
harshgMSFT 5b849596bb Fix for Issue#55 Changing Template->RouteTemplate 2014-08-06 16:14:50 -07:00
Ben Brown fca9831115 Routing Logging
Added scoped logging to RouterMiddleware, RouteCollection, and
TemplateRoute.
2014-08-01 13:59:48 -07:00
Ryan Nowak 61436fb7d1 Revert "Revert "Fix for issue 85 - Dictionary types should return null on key not found""
This is reverting the revert. We're going to go ahead with this change and
work around it in MVC.

This reverts commit 0e826e69e6.
2014-07-31 15:01:03 -07:00
Ryan Nowak 0e826e69e6 Revert "Fix for issue 85 - Dictionary types should return null on key not found"
This is causing issues with routing functional tests in CoreCLR. Suspect
CoreCLR compat issue.

This reverts commit ae65001e84.
2014-07-25 14:35:36 -07:00
Ryan Nowak ae65001e84 Fix for issue 85 - Dictionary types should return null on key not found
This change makes RouteValueDictionary a full IDictionary implementation
instead of a subclass of Dictionary.

Followed the patterns used in the old implementation, namely preserving
the struct-returning behavior of Keys/Values/GetEnumerator.
2014-07-25 13:17:52 -07:00
Ryan Nowak 3eb6c22330 Make RoutePartsEqual public. 2014-07-15 14:25:05 -07:00
Ryan Nowak 63dcdd6ca5 Fix for #77 - pass ambient values not in the template to constraints
This change adds tests and makes the behavior consistent with legacy MVC
as far as what values are visible in constraints.

This is important because it allows constraints to make decisions based on
whether or not a value is present even if it's not in the template. This
is similar to the behavior of WebAPI link generation or Area link
generation in MVC 5 - but without hardcoding.
2014-07-08 10:18:00 -07:00
harshgMSFT fbffcb7b40 Adding Remaining Inline Route Constraints. 2014-06-18 16:29:49 -07:00
harshgMSFT a499d4a92a Routing DI Changes II : Adding services for routing. 2014-06-06 17:08:01 -07:00
Ryan Nowak d10682d15b Issue aspnet/Mvc#56 - merging RouteContext and RequestContext
This is the routing part of these changes, and just the breaking changes
parts.

Follow-ups will add:
- DataTokens
- Tracking the logical stack of routers
2014-06-06 10:11:57 -07:00
Ryan Nowak 1d4ceef81b Turning on warnings as errors for routing 2014-06-04 18:42:41 -07:00
harshgMSFT 1d3e41560c Routing DI Changes I:
Moving out Default Handler and IInlineConstraintResolver from RouteCollection.
	These are moved to a new interface IRouteBuilder, (instead of an IInlineConstraintResolver, it takes in an IServiceProvider).
	This means all RouteCollectionExtensions are moved to RouteBuilderExtensions.
2014-06-03 16:50:48 -07:00
harshgMSFT 5dc8267920 Adding Tests for InlineRouting Support. 2014-05-30 12:56:04 -07:00
harshgMSFT 187d8e4911 Support for InlineConstraints in Route Template 2014-05-30 12:28:14 -07:00
Andrew Peters feb150570a Updating copyright headers 2014-05-08 23:01:29 -07:00
Ryan Nowak 8fcddc12e7 Incorporate name changes 2014-05-05 16:54:45 -07:00
anpete 51317a7039 Update file headers 2014-05-01 17:41:33 -07:00
harshgMSFT 950ce56ea5 Adding Support for NamedRoutes.
- Interface Changes.
- RouteCollectionExtensions
- Tests for Named Routes
2014-04-30 11:23:54 -07:00
Ryan Nowak 798145418f Add a verify call to a test 2014-04-02 18:58:39 -07:00
Ryan Nowak 87a47f50cc Passing more data to on GetVirtualPath
For link generation to areas, we need to provide the set of values that
the route could potentially provide.

Basically if we know what action we want to reach, we want to know whether
or not a given route could hit that action before giving it the OK to
generate a link.

For instance a route like '{controller}' couldn't hit an action like
'HomeController:DoACoolThing', since it can never provide a value for
'action'. This makes it possible for WebFX to make the right decision
without changing the behavior of any of the routing constructs. This also
has the side-effect of removing a class of order dependencies in routing
that cause bad links to be generated.
2014-03-31 12:05:47 -07:00
Yishai Galatzer 3e7d8d54f9 CR Feedback
Added and renamed tests
2014-03-31 09:32:47 -07:00
Yishai Galatzer cd0528b1b2 Link generation related tests 2014-03-31 09:31:49 -07:00
Yishai Galatzer 77ef7a5cde RouteConstraints Step II + III
Include Url Generation support
Add unit tests
Clean issues found by unit tests
2014-03-31 09:31:48 -07:00
Yishai Galatzer a917cbd577 Constraints 2014-03-27 10:58:14 -07:00
Ryan Nowak cf16d6cba7 Small refactor of TemplateBinder
We'll need to access the accepted values to do proper link generation, so
separating this process out into 2 parts.

Also moving defaults into the TemplateBinder because they are conceptually
part of the route, not part of the request. I'll do the same for
TemplateMatcher soon, but it's a big change and worth separating.
2014-03-26 18:44:57 -07:00
Ryan Nowak e1a8b5e140 Update xunit in text project and add k10 version 2014-03-17 14:48:35 -07:00
Ryan Nowak da057820e5 Rename BindPath (CR Feedback) 2014-03-10 10:02:57 -07:00
Ryan Nowak d52e000f30 Removing old comments about ancient bug numbers 2014-03-06 16:34:09 -08:00
Ryan Nowak f604fb8d87 CR feedback again 2014-03-06 12:18:31 -08:00
Ryan Nowak f43985b58d CR feedback 2014-03-06 11:27:37 -08:00
Ryan Nowak d2a3bd3490 CR feedback 2014-03-05 20:41:22 -08:00
Ryan Nowak 5d34a61bd9 API changes for Routing 2014-03-05 16:48:10 -08:00
Ryan Nowak cd73fac433 Adding API for consuming url generation 2014-03-05 13:28:44 -08:00
Ryan Nowak 89eb6e6445 Some extra resiliance and tests! Oh glorious tests. 2014-03-05 11:27:06 -08:00
Ryan Nowak 4022e5a5a4 Code dump of algorthmic code for url generation
This doesn't yet expose url generation via public api, that will come in
the next change.
2014-02-28 12:47:42 -08:00