Routing related fixes for #55
This commit is contained in:
parent
7ab93d34e4
commit
d3407ff212
|
|
@ -46,6 +46,6 @@ namespace Microsoft.AspNet.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The <see cref="Template"/>.
|
||||
/// </summary>
|
||||
public Template Template { get; set; }
|
||||
public RouteTemplate Template { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.Routing
|
|||
/// </summary>
|
||||
public static class AttributeRoutePrecedence
|
||||
{
|
||||
public static decimal Compute(Template template)
|
||||
public static decimal Compute(RouteTemplate template)
|
||||
{
|
||||
// Each precedence digit corresponds to one decimal place. For example, 3 segments with precedences 2, 1,
|
||||
// and 4 results in a combined precedence of 2.14 (decimal).
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ namespace Microsoft.AspNet.Mvc.Routing
|
|||
//
|
||||
// For a relatively simple route template, the `Template` object will hold about 500 bytes
|
||||
// of memory, so sharing is worthwhile.
|
||||
var templateCache = new Dictionary<string, Template>(StringComparer.OrdinalIgnoreCase);
|
||||
var templateCache = new Dictionary<string, RouteTemplate>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (var action in actions.Where(a => a.AttributeRouteTemplate != null))
|
||||
{
|
||||
|
|
@ -146,7 +146,7 @@ namespace Microsoft.AspNet.Mvc.Routing
|
|||
|
||||
private static RouteInfo GetRouteInfo(
|
||||
IInlineConstraintResolver constraintResolver,
|
||||
Dictionary<string, Template> templateCache,
|
||||
Dictionary<string, RouteTemplate> templateCache,
|
||||
ActionDescriptor action)
|
||||
{
|
||||
var constraint = action.RouteConstraints
|
||||
|
|
@ -173,7 +173,7 @@ namespace Microsoft.AspNet.Mvc.Routing
|
|||
|
||||
try
|
||||
{
|
||||
Template parsedTemplate;
|
||||
RouteTemplate parsedTemplate;
|
||||
if (!templateCache.TryGetValue(action.AttributeRouteTemplate, out parsedTemplate))
|
||||
{
|
||||
// Parsing with throw if the template is invalid.
|
||||
|
|
@ -228,7 +228,7 @@ namespace Microsoft.AspNet.Mvc.Routing
|
|||
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
public Template ParsedTemplate { get; set; }
|
||||
public RouteTemplate ParsedTemplate { get; set; }
|
||||
|
||||
public decimal Precedence { get; set; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue