Skip to content

Commit ea80dc5

Browse files
committed
ASP.NET
- route attribute on controller fixed
1 parent 329a04d commit ea80dc5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Angular/Writers/AngularServiceWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public virtual void Write(AngularWriteConfiguration configuration, List<ITransfe
8383
methodTemplate.AddParameter(Code.Type("{}"), "httpOptions", Code.Null());
8484
TypeTemplate subjectType = Code.Generic("Subject", returnType);
8585
methodTemplate.WithCode(Code.Declare(subjectType, "subject", Code.New(subjectType)));
86-
string uri = ("/" + (controller.Route?.Replace("[controller]", controllerName.ToLower()).TrimEnd('/') ?? controllerName) + "/" + action.Route?.Replace("[action]", action.Name.ToLower())).TrimEnd('/');
86+
string uri = ("/" + (controller.Route?.Replace("[controller]", controllerName.ToLower()).TrimEnd('/') ?? controllerName.ToLower()) + "/" + action.Route?.Replace("[action]", action.Name.ToLower())).TrimEnd('/');
8787

8888
List<HttpServiceActionParameterTransferObject> inlineParameters = action.Parameters.Where(x => !x.FromBody && x.Inline).OrderBy(x => x.InlineIndex).ToList();
8989
List<HttpServiceActionParameterTransferObject> urlParameters = action.Parameters.Where(x => !x.FromBody && !x.Inline && x.AppendName).ToList();

AspDotNet/Readers/AspDotNetControllerReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public virtual void Read(AspDotNetReadConfiguration configuration, List<ITransfe
3737
controller.Name = type.Name;
3838
controller.Language = ReflectionLanguage.Instance;
3939

40-
Attribute routeAttribute = type.GetCustomAttributes().FirstOrDefault(x => x.GetType().Name == "Route");
40+
Attribute routeAttribute = type.GetCustomAttributes().FirstOrDefault(x => x.GetType().Name == "RouteAttribute");
4141
controller.Route = routeAttribute?.GetType().GetProperty("Template")?.GetValue(routeAttribute)?.ToString();
4242

4343
MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);

0 commit comments

Comments
 (0)