diff --git a/Rest.Net/HttpListenerResponseExtensions.cs b/Rest.Net/HttpListenerResponseExtensions.cs index 0a360ae..230cca7 100644 --- a/Rest.Net/HttpListenerResponseExtensions.cs +++ b/Rest.Net/HttpListenerResponseExtensions.cs @@ -205,7 +205,7 @@ namespace MontoyaTech.Rest.Net } /// - /// Sets a redirect for a given response. + /// Sets the status code for a given response to redirect with the url to redirect to. /// /// /// diff --git a/Rest.Net/Rest.Net.csproj b/Rest.Net/Rest.Net.csproj index 521ee13..2d6824b 100644 --- a/Rest.Net/Rest.Net.csproj +++ b/Rest.Net/Rest.Net.csproj @@ -17,7 +17,7 @@ MontoyaTech.Rest.Net MontoyaTech.Rest.Net True - 1.2.7 + 1.2.8 Logo_Symbol_Black_Outline.png diff --git a/Rest.Net/RestCSharpClientGenerator.cs b/Rest.Net/RestCSharpClientGenerator.cs index e8752b1..da70051 100644 --- a/Rest.Net/RestCSharpClientGenerator.cs +++ b/Rest.Net/RestCSharpClientGenerator.cs @@ -25,20 +25,6 @@ namespace MontoyaTech.Rest.Net /// public override string Generate(List routes) { - //Remove any hidden routes from code generation. - for (int i = 0; i < routes.Count; i++) - { - var methodInfo = routes[i].GetTarget().GetMethodInfo(); - - var routeHidden = methodInfo.GetCustomAttribute(); - - if (routeHidden != null) - { - routes.RemoveAt(i); - i--; - } - } - var includedTypes = this.FindRoutesDependencies(routes); var routeGroups = this.FindRouteGroups(routes); diff --git a/Rest.Net/RestClientGenerator.cs b/Rest.Net/RestClientGenerator.cs index 67ee307..509b46f 100644 --- a/Rest.Net/RestClientGenerator.cs +++ b/Rest.Net/RestClientGenerator.cs @@ -111,6 +111,10 @@ namespace MontoyaTech.Rest.Net var methodInfo = route.GetTarget().GetMethodInfo(); + //If this route is hidden, return nothing. + if (methodInfo.GetCustomAttribute() != null) + return dependencies.ToList(); + if (methodInfo != null) { var parameters = methodInfo.GetParameters(); @@ -295,6 +299,10 @@ namespace MontoyaTech.Rest.Net { var methodInfo = route.GetTarget().GetMethodInfo(); + //Skip any routes that are hidden. + if (methodInfo.GetCustomAttribute() != null) + continue; + var routeGroup = methodInfo.GetCustomAttribute(); //If there wasn't a route group on the method, see if there is one on the declaring type.