From 2d8849d2b3fbdc3d1afb717e80e0745a339b2254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= Date: Mon, 20 Feb 2017 20:58:57 +0000 Subject: [PATCH 1/4] support for controller attribute routing --- .../Controllers/RouteAttributeController.cs | 12 +++- .../DefaultRouteDispatcherTests.cs | 15 +++- Hyprlinkr/DefaultRouteDispatcher.cs | 64 +++++++++++++----- UpgradeLog.htm | Bin 0 -> 36888 bytes 4 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 UpgradeLog.htm diff --git a/Hyprlinkr.UnitTest/Controllers/RouteAttributeController.cs b/Hyprlinkr.UnitTest/Controllers/RouteAttributeController.cs index 918e9f3..bf02b33 100644 --- a/Hyprlinkr.UnitTest/Controllers/RouteAttributeController.cs +++ b/Hyprlinkr.UnitTest/Controllers/RouteAttributeController.cs @@ -6,14 +6,22 @@ namespace Ploeh.Hyprlinkr.UnitTest.Controllers { + [Route("/controllerCustomRoute", Name = ControllerRouteName)] public class RouteAttributeController : ApiController { - public const string RouteName = "CustomRoute"; + public const string ControllerRouteName = "ControllerCustomRoute"; - [Route("/customRoute", Name = RouteName)] + public const string ActionRouteName = "CustomRoute"; + + [Route("/customRoute", Name = ActionRouteName)] public object GetDefault() { return new object(); } + + public object GetDefaultWithoutActionRouteName() + { + return new object(); + } } } diff --git a/Hyprlinkr.UnitTest/DefaultRouteDispatcherTests.cs b/Hyprlinkr.UnitTest/DefaultRouteDispatcherTests.cs index 1e18352..79e1222 100644 --- a/Hyprlinkr.UnitTest/DefaultRouteDispatcherTests.cs +++ b/Hyprlinkr.UnitTest/DefaultRouteDispatcherTests.cs @@ -60,7 +60,7 @@ public void DispatchReturnsResultWithCustomRouteName( { var actual = sut.Dispatch(method, routeValues); Assert.Equal(sut.RouteName, actual.RouteName); - } + } [Theory, AutoHypData] public void DispatchReturnsResultWithRouterAttributeRouteName( @@ -70,7 +70,18 @@ public void DispatchReturnsResultWithRouterAttributeRouteName( Expression> exp = c => c.GetDefault(); var method = (MethodCallExpression)exp.Body; var actual = sut.Dispatch(method, routeValues); - Assert.Equal(RouteAttributeController.RouteName, actual.RouteName); + Assert.Equal(RouteAttributeController.ActionRouteName, actual.RouteName); + } + + [Theory, AutoHypData] + public void DispatchReturnsResultWithRouterAttributeControllerRouteName( + DefaultRouteDispatcher sut, + IDictionary routeValues) + { + Expression> exp = c => c.GetDefaultWithoutActionRouteName(); + var method = (MethodCallExpression)exp.Body; + var actual = sut.Dispatch(method, routeValues); + Assert.Equal(RouteAttributeController.ControllerRouteName, actual.RouteName); } [Theory, AutoHypData] diff --git a/Hyprlinkr/DefaultRouteDispatcher.cs b/Hyprlinkr/DefaultRouteDispatcher.cs index 5d6e8b9..ab07b8b 100644 --- a/Hyprlinkr/DefaultRouteDispatcher.cs +++ b/Hyprlinkr/DefaultRouteDispatcher.cs @@ -78,26 +78,14 @@ public Rouple Dispatch( if (method == null) throw new ArgumentNullException("method"); - var routeAttribute = method - .Method - .GetCustomAttribute(false); + var methodRouteAttribute = method.Method.GetCustomAttribute(false); - if (routeAttribute != null && routeAttribute.Name != null) + if (methodRouteAttribute?.Name != null) { - return new Rouple(routeAttribute.Name, routeValues); + return new Rouple(methodRouteAttribute.Name, routeValues); } - var newRouteValues = new Dictionary(routeValues); - - var controllerName = method - .Object - .Type - .Name - .ToLowerInvariant() - .Replace("controller", ""); - newRouteValues["controller"] = controllerName; - - return new Rouple(this.routeName, newRouteValues); + return ExtractRoupleFromController(method, routeValues); } /// @@ -108,5 +96,49 @@ public string RouteName { get { return this.routeName; } } + + private Rouple ExtractRoupleFromController(MethodCallExpression callExpression, IDictionary routeValues) + { + var controllerRouteName = RouteName; + var newRouteValues = AddControllerNameAndMethodToRouteValues(callExpression, routeValues); + var controllerRouteAttribute = callExpression.Object.Type.GetCustomAttribute(false); + if (controllerRouteAttribute != null) + { + if (controllerRouteAttribute.Name != null) + { + controllerRouteName = controllerRouteAttribute.Name; + } + + newRouteValues = RemoveControllerAndActionRouteValuesIfNeeded(controllerRouteAttribute, newRouteValues); + } + + return new Rouple(controllerRouteName, newRouteValues); + } + + private static Dictionary RemoveControllerAndActionRouteValuesIfNeeded(RouteAttribute controllerRouteAttribute, Dictionary routeValues) + { + var controllerRouteTemplate = controllerRouteAttribute.Template; + if (controllerRouteTemplate != null) + { + if (!controllerRouteTemplate.Contains("{controller}")) + { + routeValues.Remove("controller"); + } + if (!controllerRouteTemplate.Contains("{action}")) + { + routeValues.Remove("action"); + } + } + return routeValues; + } + + private static Dictionary AddControllerNameAndMethodToRouteValues(MethodCallExpression callExpression, IDictionary routeValues) + { + var newRouteValues = new Dictionary(routeValues); + var controllerName = callExpression.Object.Type.Name.ToLowerInvariant().Replace("controller", ""); + newRouteValues["controller"] = controllerName; + newRouteValues["action"] = callExpression.Method.Name.ToLowerInvariant(); + return newRouteValues; + } } } diff --git a/UpgradeLog.htm b/UpgradeLog.htm new file mode 100644 index 0000000000000000000000000000000000000000..26f76dbc66497fcfaa143cc8de29f07e62ff8184 GIT binary patch literal 36888 zcmeI5`BNLolE?ekw-Nh4Xw1GbvkbR6Y(LM00D&=wxeT_4i5GylPb2P`_x|+V{d_Aa zS9eRa)IwlSETNFPySgeXD>Eyvs&4)7|NJBRAsUO`N2AeF^eLK)N>L%&iO!oqSNS@T7~GGvxDeO)E@Ql>5X1QKT&U;yXU}p741ex z95<y8S%vG0gZ#|(aYSh)+Mxa>ch@-Y$B(?eW{mC+LYb-p~GVhOjOsf)9)MVZgSm8e-+M+5@*o~C7aO~N_QE* zYKyz9odz|{$7r?l#!Z_l#=?USDwT5MBqjhfcB z5XD0J`EFO+FcOa{TwgoY859w#Fw%iyBlt~H- ze8ufu@YPkByBknhQlat!u)1^gE?HNNEkf;W?u!E-kiut?IJHE* z9ZEI7bv@yDvdOHo>t(J_8M9`al}IN^V|4P>yGzm%Ap8`XW zG}^py{^j_WN19Cj-$DV6L3HS)-{dTiPV>53Tn_U=_zG8*1PzgQ7VOYx9-Nz-0o7dU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fz{9AtS1*%FsU@9#qbtF3BU?y74vDs9y*pJc4{GFDCH?^Uv@ zV}<&%R^6s~>8pnIB#)0FkJWVlJ|r|9dncu_+Pj!b_@rableQ-g!V{-)iIUHe?xRuZ zO}C4~{p&`%N#D%I5g(b~9he?{{m8bJex;9v)0qH|U6Hs&85keaXuh&yR|7EHOx0(*sK6EWungu>zS{-*;W+ Date: Wed, 22 Feb 2017 08:46:49 +0000 Subject: [PATCH 2/4] support for controller-level route attribute --- Hyprlinkr/DefaultRouteDispatcher.cs | 38 ++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/Hyprlinkr/DefaultRouteDispatcher.cs b/Hyprlinkr/DefaultRouteDispatcher.cs index ab07b8b..6da3d2d 100644 --- a/Hyprlinkr/DefaultRouteDispatcher.cs +++ b/Hyprlinkr/DefaultRouteDispatcher.cs @@ -70,17 +70,16 @@ public DefaultRouteDispatcher(string routeName) /// . /// /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "This method should produce URIs with lower-case letters, so ultimately, it would have to invoke some sort of ToLower method.")] public Rouple Dispatch( MethodCallExpression method, IDictionary routeValues) { if (method == null) throw new ArgumentNullException("method"); - + var methodRouteAttribute = method.Method.GetCustomAttribute(false); - if (methodRouteAttribute?.Name != null) + if (methodRouteAttribute != null && methodRouteAttribute.Name != null) { return new Rouple(methodRouteAttribute.Name, routeValues); } @@ -97,21 +96,35 @@ public string RouteName get { return this.routeName; } } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "This method should produce URIs with lower-case letters, so ultimately, it would have to invoke some sort of ToLower method.")] private Rouple ExtractRoupleFromController(MethodCallExpression callExpression, IDictionary routeValues) - { - var controllerRouteName = RouteName; - var newRouteValues = AddControllerNameAndMethodToRouteValues(callExpression, routeValues); - var controllerRouteAttribute = callExpression.Object.Type.GetCustomAttribute(false); + { + var controllerType = callExpression.Object.Type; + + var controllerRouteAttribute = controllerType.GetCustomAttribute(false); if (controllerRouteAttribute != null) { - if (controllerRouteAttribute.Name != null) - { - controllerRouteName = controllerRouteAttribute.Name; - } + return ExtractRoupleFromControllerRouteAttribute(callExpression, routeValues, controllerRouteAttribute); + } + + var controllerName = controllerType.Name.ToLowerInvariant().Replace("controller", ""); - newRouteValues = RemoveControllerAndActionRouteValuesIfNeeded(controllerRouteAttribute, newRouteValues); + var newRouteValues = new Dictionary(routeValues); + newRouteValues["controller"] = controllerName; + + return new Rouple(this.routeName, newRouteValues); + } + + private Rouple ExtractRoupleFromControllerRouteAttribute(MethodCallExpression callExpression, IDictionary routeValues, RouteAttribute controllerRouteAttribute) + { + var controllerRouteName = this.routeName; + if (controllerRouteAttribute.Name != null) + { + controllerRouteName = controllerRouteAttribute.Name; } + var newRouteValues = AddControllerNameAndMethodToRouteValues(callExpression, routeValues); + newRouteValues = RemoveControllerAndActionRouteValuesIfNeeded(controllerRouteAttribute, newRouteValues); return new Rouple(controllerRouteName, newRouteValues); } @@ -132,6 +145,7 @@ private static Dictionary RemoveControllerAndActionRouteValuesIf return routeValues; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "This method should produce URIs with lower-case letters, so ultimately, it would have to invoke some sort of ToLower method.")] private static Dictionary AddControllerNameAndMethodToRouteValues(MethodCallExpression callExpression, IDictionary routeValues) { var newRouteValues = new Dictionary(routeValues); From 39e705537e974b03eae07eca68803b35f0892aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= Date: Wed, 22 Feb 2017 17:48:03 +0000 Subject: [PATCH 3/4] limit line lengths to 120 characters --- Hyprlinkr/DefaultRouteDispatcher.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Hyprlinkr/DefaultRouteDispatcher.cs b/Hyprlinkr/DefaultRouteDispatcher.cs index 6da3d2d..2900e9b 100644 --- a/Hyprlinkr/DefaultRouteDispatcher.cs +++ b/Hyprlinkr/DefaultRouteDispatcher.cs @@ -97,7 +97,9 @@ public string RouteName } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "This method should produce URIs with lower-case letters, so ultimately, it would have to invoke some sort of ToLower method.")] - private Rouple ExtractRoupleFromController(MethodCallExpression callExpression, IDictionary routeValues) + private Rouple ExtractRoupleFromController( + MethodCallExpression callExpression, + IDictionary routeValues) { var controllerType = callExpression.Object.Type; @@ -115,7 +117,10 @@ private Rouple ExtractRoupleFromController(MethodCallExpression callExpression, return new Rouple(this.routeName, newRouteValues); } - private Rouple ExtractRoupleFromControllerRouteAttribute(MethodCallExpression callExpression, IDictionary routeValues, RouteAttribute controllerRouteAttribute) + private Rouple ExtractRoupleFromControllerRouteAttribute( + MethodCallExpression callExpression, + IDictionary routeValues, + RouteAttribute controllerRouteAttribute) { var controllerRouteName = this.routeName; if (controllerRouteAttribute.Name != null) @@ -128,7 +133,9 @@ private Rouple ExtractRoupleFromControllerRouteAttribute(MethodCallExpression ca return new Rouple(controllerRouteName, newRouteValues); } - private static Dictionary RemoveControllerAndActionRouteValuesIfNeeded(RouteAttribute controllerRouteAttribute, Dictionary routeValues) + private static Dictionary RemoveControllerAndActionRouteValuesIfNeeded( + RouteAttribute controllerRouteAttribute, + Dictionary routeValues) { var controllerRouteTemplate = controllerRouteAttribute.Template; if (controllerRouteTemplate != null) @@ -146,7 +153,9 @@ private static Dictionary RemoveControllerAndActionRouteValuesIf } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "This method should produce URIs with lower-case letters, so ultimately, it would have to invoke some sort of ToLower method.")] - private static Dictionary AddControllerNameAndMethodToRouteValues(MethodCallExpression callExpression, IDictionary routeValues) + private static Dictionary AddControllerNameAndMethodToRouteValues( + MethodCallExpression callExpression, + IDictionary routeValues) { var newRouteValues = new Dictionary(routeValues); var controllerName = callExpression.Object.Type.Name.ToLowerInvariant().Replace("controller", ""); From 832a20268635bcd5c0c104bbb31488e6d6638581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= Date: Wed, 22 Feb 2017 20:40:32 +0000 Subject: [PATCH 4/4] delete UpgradeLog.htm --- UpgradeLog.htm | Bin 36888 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 UpgradeLog.htm diff --git a/UpgradeLog.htm b/UpgradeLog.htm deleted file mode 100644 index 26f76dbc66497fcfaa143cc8de29f07e62ff8184..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36888 zcmeI5`BNLolE?ekw-Nh4Xw1GbvkbR6Y(LM00D&=wxeT_4i5GylPb2P`_x|+V{d_Aa zS9eRa)IwlSETNFPySgeXD>Eyvs&4)7|NJBRAsUO`N2AeF^eLK)N>L%&iO!oqSNS@T7~GGvxDeO)E@Ql>5X1QKT&U;yXU}p741ex z95<y8S%vG0gZ#|(aYSh)+Mxa>ch@-Y$B(?eW{mC+LYb-p~GVhOjOsf)9)MVZgSm8e-+M+5@*o~C7aO~N_QE* zYKyz9odz|{$7r?l#!Z_l#=?USDwT5MBqjhfcB z5XD0J`EFO+FcOa{TwgoY859w#Fw%iyBlt~H- ze8ufu@YPkByBknhQlat!u)1^gE?HNNEkf;W?u!E-kiut?IJHE* z9ZEI7bv@yDvdOHo>t(J_8M9`al}IN^V|4P>yGzm%Ap8`XW zG}^py{^j_WN19Cj-$DV6L3HS)-{dTiPV>53Tn_U=_zG8*1PzgQ7VOYx9-Nz-0o7dU zg}x`~QPJ6sp~RmxClNt@r4etSp19e^I8UHdb1-YoV6$2AxmThW|82G(@z`Xc(^=y) za5l?Wa3c`K+OTB3x8FXlWknAdYnjpI)4*OsrL{;OTDb&z?mL@2W`UcRa8mY4 zo`*Pk#Hdf5&N;}5V=HE=(LHXjs%PpmJT$Y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