Commit Graph

200 Commits

Author SHA1 Message Date
Ryan Nowak 9ee946073a Add support for best-effort link-generation
This change adds a feature needed for aspnet/Mvc#302

There's a new option in routing that allows link-generation to proceed
when the route values cannot be validated. The key scenario for this is
during development of an MVC site. Routing will refuse to generate a link
to actions which don't exists, this is a breaking change from the MVC5
behavior. Setting UseBestEffortLinkGeneration will allow routing to return
a value even when we can't match the action.

This option will remain off by default - setting this to on will impact
link-generation in a bunch of scenarios involving areas where we've
improved the logic for MVC6. If you're considering leaving this on outside
of development scenarios, then make sure to be as explicit with route values
as possible (don't rely on ambient values).

Functional tests to follow up in the MVC repo.
2015-02-11 14:38:30 -08:00
Mugdha Kulkarni 4e5fc2e2dd Fixing Routing Issue: 136
The RegEx inline constraint doesn't take care of Escape characters.
2015-02-10 11:16:30 -08:00
sornaks 67dcdbf8a1 Issue #1669: Adding extension method ConfigureRouteOptions. 2015-02-03 16:18:19 -08:00
Doug Bunting c59366e8a7 Quick cleanup
- `DefaultInlineConstraintResolver` has no need of a `IServiceProvider`

nits:
- add doc comments for changed `DefaultInlineConstraintResolver` ctor
- let VS add a dev server port to sample's .kproj
- add debugSettings.json and .vs/ to .gitignore
2015-01-30 10:02:58 -08:00
Wei Wang e1ff9ae259 Merge remote-tracking branch 'origin/release' into dev 2015-01-29 16:32:08 -08:00
Pranav K f51fe93b1c Fixing NuGet.config 2015-01-28 23:18:29 -08:00
Wei Wang edc0aef067 Change SKIP_DOTNET_INSTALL to SKIP_KRE_INSTALL 2015-01-28 18:28:47 -08:00
Wei Wang fe2c5c5288 Update build.cmd and build.sh to use kvm 2015-01-28 18:28:28 -08:00
Wei Wang 95b91a60d4 Merge branch 'release' of github.com:aspnet/Routing into release 2015-01-28 18:27:58 -08:00
Pranav K c5c89fdaf8 Merge branch 'release' into dev 2015-01-23 16:49:05 -08:00
Pranav K 29a5cb8aa9 Change the namespace for the MapRoute extension 2015-01-23 16:08:38 -08:00
Suhas Joshi 2ac0715cdc Merge branch 'release' into dev 2015-01-21 15:50:46 -08:00
Suhas Joshi 26d7a6f6ee Updating to release NuGet.config 2015-01-21 15:50:36 -08:00
Wei Wang 7b2bd8681f Rename SKIP_KRE_INSTALL to SKIP_DOTNET_INSTALL 2015-01-20 18:32:52 -08:00
Suhas Joshi 4265934e12 Updating NuGet.config 2015-01-20 17:23:53 -08:00
Pranav K ef7e044942 Updating build.cmd and build.sh to use dotnetsdk 2015-01-20 01:36:35 -08:00
Pranav K e0b5c19082 Updating build.cmd and build.sh to use dotnetsdk 2015-01-20 01:32:36 -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
Chris Ross 5e55833168 Handle PipelineCore rename. 2015-01-15 14:27:53 -08:00
Chris Ross 01620d487e Update QueryBuilder dependency. 2015-01-12 10:34:39 -08:00
Ryan Nowak c323e4d32f Updating routing to use official xunit runner 2014-12-15 16:11:17 -08:00
Suhas Joshi 7ce8d6c801 Updating to dev NuGet.config 2014-12-08 15:24:50 -08:00
Suhas Joshi 3229ae2d7a Updating to release NuGet.config 2014-12-08 15:14:58 -08:00
Yishai Galatzer 1bded288bf Missing setter for default handler on IRouteBuilder
CR in person with pranavkm
2014-12-04 17:33:45 -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
Doug Bunting 0e3e53dcfe Address aspnet/razor#236, recreate XML files when xml-docs-test target is run directly
- must still `build initialize` between `git clean` and `build xml-docs-test`

nit: add description of xml-docs-test target
2014-11-30 21:30:59 -08:00
Victor Hurdugaci 8b93a0c018 Add schema version to kproj files 2014-11-25 11:01:35 -08:00
Hao Kung 21a6f44c38 GetDefaultServices -> AddRouting with TryAdd 2014-11-24 16:37:10 -08:00
Doug Bunting 1f67f69205 Add missing license headers
- #EngineeringDay
2014-11-20 23:25:52 -08:00
Doug Bunting 9d7f971833 Add xml-docs-test target to end of default build
- #EngineeringDay
- correct couple of XML doc issues in the repo (simplify references)
2014-11-20 10:16:01 -08:00
Doug Bunting 3b0e289387 Apply VS' FormatDocument and RemoveAndSort to all *.cs files
- #EngineeringDay
- this repo was relatively clean
2014-11-20 10:09:28 -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
Ajay Bhargav Baaskaran 91c3a550f1 changed contracts.assert to debug.assert 2014-11-18 13:52:42 -08:00
Ryan Nowak 5c116db6a5 Add a sample of building a customize 'MapRoute' method
This is a sample of the pattern for building a MapRoute method that
customizes routing by adding constraints, datatokens, or defaults. This is
the replacement for adding data to the route directly.

Also fixed up the sample to work. It was massively out of date.
2014-11-18 11:58:29 -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
Pranav K 72604cb327 Fixing dev NuGet.config 2014-11-06 22:05:03 -08:00
Pranav K 45f6bcde4a Merge branch 'release' into dev 2014-11-06 12:49:52 -08:00
Pranav K 087552dc5f Updating to release NuGet.config 2014-11-06 12:49:38 -08:00
Pranav K c72dc37f0e Merge branch 'release' into dev 2014-11-06 10:48:49 -08:00
Pranav K 674324ec28 Updating to release NuGet.config 2014-11-06 10:48:46 -08:00
SonjaKhan 673854b060 renaming TraceType to LogLevel 2014-11-05 10:47:42 -08:00
Ryan Nowak 08c591c74b Fix for #104 - RouterMiddleware should take ILoggerFactory in the
constructor

Did some cleanup here to make these tests work on CoreCLR. They weren't
using Moq for anything important.
2014-11-03 12:38:17 -08:00
Ryan Nowak 87f0bbb092 adding tests 2014-10-31 16:00:04 -07:00
Ryan Nowak aae9e67773 add docs 2014-10-31 15:02:54 -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
Kirthi Krishnamraju bc0b61b6f2 Merge branch 'release' into dev 2014-10-29 13:19:43 -07:00
Kirthi Krishnamraju 40b2da7cc7 Added description to project.json 2014-10-29 11:45:42 -07:00
Pranav K b95247d3c4 Merge branch 'release' into dev 2014-10-28 12:36:55 -07:00
Pranav K 0350ca1dba Switching TraceType to Verbose 2014-10-27 16:27:58 -07:00
Pranav K 16725ac0d7 Adding reference to System.Reflection.Extensions 2014-10-24 01:09:02 -07:00