Skip to content

Commit

Permalink
Another fix for @Url.RouteUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
salarcode committed Dec 30, 2016
1 parent 06ea79d commit 3514cd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions LowercaseDashedRouting/LowercaseDashedRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ public override VirtualPathData GetVirtualPath(RequestContext requestContext, Ro
{
var originalAction = values["action"] as string;
var originalController = values["controller"] as string;
string dashedAction, dashedController;
string dashedAction = originalAction, dashedController = originalController;


values["action"] = dashedAction = AddDashesBeforeCapitals(originalAction).ToLowerInvariant();
values["controller"] = dashedController = AddDashesBeforeCapitals(originalController).ToLowerInvariant();
if (originalAction != null)
values["action"] = dashedAction = AddDashesBeforeCapitals(originalAction).ToLowerInvariant();
if (originalController != null)
values["controller"] = dashedController = AddDashesBeforeCapitals(originalController).ToLowerInvariant();

// FIX: for when the 'action' is not mentioned and the default value which is stored in the RouteData is about to be used!
var currentValues = requestContext.RouteData.Values;
Expand Down
4 changes: 2 additions & 2 deletions LowercaseDashedRouting/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyVersion("1.3.3.0")]
[assembly: AssemblyFileVersion("1.3.3.0")]

0 comments on commit 3514cd0

Please sign in to comment.