Routing related fixes for #55

This commit is contained in:
harshgMSFT 2014-08-05 15:32:42 -07:00
parent 7ab93d34e4
commit d3407ff212
3 changed files with 6 additions and 6 deletions

View File

@ -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; }
}
}

View File

@ -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).

View File

@ -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; }