Skip to content

Commit bf743d0

Browse files
committed
#38 - ApiController gets ignored when using [FromServices] Attribute on route
1 parent f229663 commit bf743d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

AspDotNet/Readers/AspDotNetControllerReader.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public virtual void Read(AspDotNetReadConfiguration configuration, List<ITransfe
5252
{
5353
continue;
5454
}
55-
55+
5656
List<Attribute> methodAttributes = method.GetCustomAttributes().ToList();
5757
Dictionary<HttpServiceActionTypeTransferObject, string> actionTypes = this.GetActionTypes(methodAttributes);
5858
if (actionTypes.Count == 0)
@@ -102,7 +102,7 @@ public virtual void Read(AspDotNetReadConfiguration configuration, List<ITransfe
102102
action.ReturnType = returnType.ToTransferObject();
103103
action.Route = actionType.Value ?? fallbackRoute;
104104
action.Type = actionType.Key;
105-
ParameterInfo[] parameters = method.GetParameters();
105+
ParameterInfo[] parameters = method.GetParameters().Where(parameter => parameter.GetCustomAttributes().All(attribute => attribute.GetType().Name != "FromServicesAttribute")).ToArray();
106106
foreach (ParameterInfo parameter in parameters)
107107
{
108108
this.modelReader.Read(parameter.ParameterType, transferObjects);

0 commit comments

Comments
 (0)