Commit Graph

140 Commits

Author SHA1 Message Date
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 c911a10692 Add Routing.Abstractions 2015-12-02 16:43:35 -08:00
Ryan Nowak 4441fba4ee Clean up folders and test names 2015-11-30 09:36:07 -08:00
Ryan Nowak 123eaf2278 Fix #233 - Routing stops when constraint is rejected
The fix here is to 'continue' instead of 'return'. Added the relevant test
cases, which only had positive cases for constraints.
2015-11-30 09:28:15 -08:00
Ryan Nowak d4b96b27c0 Optimize RouteValueDictionary, expose concrete type
This change optimizes allocations by RouteValueDictionary based on usage.

First, implement a struct Enumerator, and expose the concrete RVD type
from all extensibility points. We wanted to try and decouple this code
from RVD originally and use IDictionary everywhere. After doing that we've
found that it allocates an unacceptable number of enumerators.

Secondly, optimize copies of RVD for the case where you're copying an RVC
to another (common case). When doing this we can copy the count to get the
right capacity, and copy the entries without allocating an enumerator.

Lastly, optimize RVD for the case where it's a wrapper around a poco
object. We 'upgrade' to a writable full dictionary if you try to write to
it, or call one of a number of APIs that are uncommonly used. We could
produce optimized versions of things like `Keys` and `CopyTo` if necessary
in the future.
2015-11-25 09:49:10 -08:00
Pranav K cad81fa608 Updating tests to use moq.netcore 2015-11-23 12:24:35 -08:00
John Luo 825f82d7e0 Reacting to ApplicationServices removal from HttpContext 2015-11-19 09:40:46 -08:00
Ajay Bhargav Baaskaran 4d69ad0db2 Moved AttributeRouting from MVC 2015-11-17 12:03:12 -08:00
Ajay Bhargav Baaskaran cef221f57a Added Template property to RouteTemplate 2015-11-12 15:28:02 -08:00
John Luo 83f20ece7d Reacting to RequestDelegate namespace change 2015-10-30 13:58:05 -07:00
Ryan Nowak a5727dc932 Incorporate StringSegment from primitives 2015-10-08 12:44:59 -07:00
Ryan Nowak 371d4e62da Remove string.Split from routing
This change removes the call to string.Split and a few substrings, and
replaces it with a tokenizer API. The tokenizer isn't really optimized
right now for compute - it should probably be an iterator- but it's a
significant improvement on what we're doing.
2015-10-06 10:21:00 -07:00
Pranav K 2f8dba6659 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:48 -07:00
Anthony van der Hoorn 59b698c8b2 Expose parsed route so that observers can get extra details about the route (i.e. optional state) 2015-09-23 09:00:28 -07:00
Pranav K c6941e797f Replacing NotNullAttribute with exceptions 2015-09-11 15:08:04 -07:00
N. Taylor Mullen 5ec25174ff Update project.json to have warningsAsErrors accept a bool. 2015-09-02 15:34:53 -07:00
Hao Kung 3cab10cfd7 React to options rename 2015-09-02 13:55:39 -07:00
Pranav K fe9bf8bcbf Remove the use of Regex in the TemplateRouteParser
Fixes #164
2015-08-03 11:13:57 -07:00
Pranav K ae27f7d321 Updating InlineRouteParameterParserTests to perform Assert.Equal \
Assert.Collection instead of Assert.Single.

This gives more accurate failures in case the assertions fail.
2015-07-29 18:27:12 -07:00
Mugdha Kulkarni ddfe5e9736 Adding more test cases before removing RegEx for parameter matching 2015-07-21 15:09:15 -07:00
Ajay Bhargav Baaskaran 0882a393a4 Removed unwanted logging for non-matching routes 2015-06-23 10:53:58 -07:00
Ajay Bhargav Baaskaran b135a9d53b [Fixes #188] Added support for AppendTrailingSlash in RouteOptions 2015-06-19 11:46:25 -07:00
Chris R e30ca4d673 React to Http namespace changes. 2015-05-07 13:59:32 -07:00
Doug Bunting efe39e43f5 Remove test the `[NotNull]` move makes irrelevant 2015-05-06 14:47:05 -07:00
Kiran Challa f2e6c294b0 Address feedback for PR: https://github.com/aspnet/Routing/pull/182 2015-05-05 12:39:32 -07:00
N. Taylor Mullen 352732fc62 Update LICENSE.txt and license header on files. 2015-05-01 13:59:22 -07:00
Kiran Challa 1f6d3fe4cc Fix RouteValueDictionary to handle read-only dictionaries. 2015-05-01 11:55:01 -07:00
Chris Ross b5fd971562 Handle Http.Core rename. 2015-04-16 14:36:48 -07:00
Kiran Challa 1c66e0a317 Cleanup logging
- Removed existing logger scopes as we want to minimize the number of scopes being created.
- Cleaned up tests related to removal of scopes.
- Added new log statements.
- Removed old logger structure base implementation and related tests. Added new tests also.
2015-04-08 14:20:36 -07:00
Kiran Challa 6e18fc2f74 Reacting to ILogger api changes 2015-04-04 01:24:42 -07:00
Doug Bunting 9d35441ac3 Add another `<Service/>` item 2015-04-02 22:56:56 -07:00
Doug Bunting 458a0f6809 Update .xproj files for Microsoft.Web.AspNet.* -> Microsoft.DNX.* rename 2015-04-02 13:49:28 -07:00
ianhong ff209f04bb Should GetVirtualPath returns PathString 2015-03-22 19:39:20 -07:00
ianhong 3693002b02 Introducing VirtualPathData for IRouter.GetVirtualPath 2015-03-19 21:59:20 -07:00
Hao Kung 0db1f1a42f React to hosting 2015-03-19 21:02:35 -07:00
sornaks 37dc8581de Removing 'Options' from the 'ConfigureRouteOptions' extension method name. 2015-03-16 14:54:36 -07:00
N. Taylor Mullen 2bd73523f6 Update xunit.runner.kre => xunit.runner.aspnet. 2015-03-12 16:10:07 -07:00
N. Taylor Mullen 81c43301d3 Update .kproj => .xproj. 2015-03-11 14:04:11 -07:00
N. Taylor Mullen 2973795a6e Remove BOM from project.json, *.cmd, *.sh and *.shade files. 2015-03-09 12:58:37 -07:00
N. Taylor Mullen da775351e2 Update aspnet50/aspnetcore50 => dnx451/dnxcore50. 2015-03-08 12:55:34 -07:00
Brennan 3e99d38dbb Logging.Testing namespace change 2015-03-06 09:48:36 -08:00
Brennan c2a89b14a2 Removing Null* using Testing Null* classes 2015-03-04 19:59:31 -08:00
Brennan 859a0d62b8 Logging API changes 2015-03-04 19:59:23 -08:00
Hao Kung 979b75dda4 React to DI changes 2015-03-04 18:06:42 -08:00
Brennan be7984eebc Logging test objects were copy-pasta from logging repo, removing and using official version 2015-02-25 12:58:51 -08:00
Mugdha Kulkarni 81a17300b2 Issue 140: Support lower case routes 2015-02-20 14:54:25 -08:00
Luke Waters f41b6e4d10 other interface implementation 2015-02-19 15:14:41 -08:00
Luke Waters b0b1bb3032 fixing logging interface change 2015-02-19 15:03:29 -08:00
Mugdha Kulkarni f9a9b80681 Fixing the error message. The error message for malformed template was too complex listing all
the errors that can happen in one message. I have separated the message in 2 different messages.
 1. When there is a parameter or a literal following the optional parameter.
 2. when optional parameter is preceded by a literal other than period which is not allowed.
2015-02-16 17:40:04 -08:00
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