Skip to content
Browse files

tidied up some code and comments.

  • Loading branch information...
1 parent a385dd6 commit 20ca622474afccf4afa16a12d38df9503810d5fb @mccalltd committed Apr 26, 2012
View
6 src/AttributeRouting/Framework/RouteBuilder.cs
@@ -3,7 +3,6 @@
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
-using AttributeRouting.Constraints;
using AttributeRouting.Framework.Factories;
using AttributeRouting.Helpers;
@@ -309,7 +308,7 @@ private string CreateRouteUrl(string routeUrl, string routePrefix, string areaUr
var detokenizedUrl = DetokenizeUrl(CreateRouteUrl(routeSpec));
var urlParameterNames = GetUrlParameterContents(detokenizedUrl);
- // Convention-based constraints
+ // Globally configured constraints
foreach (var defaultConstraint in _configuration.DefaultRouteConstraints)
{
var pattern = defaultConstraint.Key;
@@ -376,8 +375,7 @@ private IEnumerable<IAttributeRoute> CreateRouteTranslations(RouteSpecification
foreach (var provider in _configuration.TranslationProviders)
{
translatedRouteUrl = translatedRouteUrl ?? provider.TranslateRouteUrl(cultureName, routeSpec);
- translatedRoutePrefix = translatedRoutePrefix ??
- provider.TranslateRoutePrefix(cultureName, routeSpec);
+ translatedRoutePrefix = translatedRoutePrefix ?? provider.TranslateRoutePrefix(cultureName, routeSpec);
translatedAreaUrl = translatedAreaUrl ?? provider.TranslateAreaUrl(cultureName, routeSpec);
}
View
10 src/AttributeRouting/Framework/RouteReflector.cs
@@ -48,8 +48,8 @@ private IEnumerable<RouteSpecification> GenerateRouteSpecifications(IEnumerable<
let routePrefixAttribute = controllerType.GetCustomAttribute<RoutePrefixAttribute>(true)
from actionMethod in controllerType.GetActionMethods(inheritActionsFromBaseController)
from routeAttribute in GetRouteAttributes(actionMethod, convention)
- orderby controllerIndex , routeAttribute.Precedence
// precedence is within a controller
+ orderby controllerIndex, routeAttribute.Precedence
let routeName = routeAttribute.RouteName
let subdomain = GetAreaSubdomain(routeAreaAttribute)
select new RouteSpecification
@@ -63,7 +63,6 @@ private IEnumerable<RouteSpecification> GenerateRouteSpecifications(IEnumerable<
ControllerType = controllerType,
ControllerName = controllerType.GetControllerName(),
ActionName = actionMethod.Name,
- ActionParameters = actionMethod.GetParameters(),
RouteUrl = routeAttribute.RouteUrl,
RouteUrlTranslationKey = routeAttribute.TranslationKey,
HttpMethods = routeAttribute.HttpMethods,
@@ -96,9 +95,8 @@ private static string GetAreaUrl(RouteAreaAttribute routeAreaAttribute, string s
if (routeAreaAttribute == null)
return null;
- // If a subdomain is specified for the area either in the RouteAreaAttribute or via
- // configuration, then assume the area url is blank;
- // eg: admin.badass.com.
+ // If a subdomain is specified for the area either in the RouteAreaAttribute
+ // or via configuration, then assume the area url is blank; eg: admin.badass.com.
// However, our fearless coder can decide to explicitly specify an area url if desired;
// eg: internal.badass.com/admin.
if (subdomain.HasValue() && routeAreaAttribute.AreaUrl.HasNoValue())
@@ -112,7 +110,7 @@ private string GetAreaSubdomain(RouteAreaAttribute routeAreaAttribute)
if (routeAreaAttribute == null)
return null;
- // Check for a subdomain ovveride specified via configuration object.
+ // Check for a subdomain override specified via configuration object.
var subdomainOverride = (from o in _configuration.AreaSubdomainOverrides
where o.Key == routeAreaAttribute.AreaName
select o.Value).FirstOrDefault();
View
4 src/AttributeRouting/Framework/RouteSpecification.cs
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
-using System.Reflection;
namespace AttributeRouting.Framework
{
public class RouteSpecification
{
public RouteSpecification()
{
- ActionParameters = new ParameterInfo[0];
DefaultAttributes = new List<RouteDefaultAttribute>();
ConstraintAttributes = new List<RouteConstraintAttributeBase>();
}
@@ -29,8 +27,6 @@ public RouteSpecification()
public string ActionName { get; set; }
- public ParameterInfo[] ActionParameters { get; set; }
-
public string RouteUrl { get; set; }
public string RouteUrlTranslationKey { get; set; }

0 comments on commit 20ca622

Please sign in to comment.
Something went wrong with that request. Please try again.