Skip to content

Commit

Permalink
Fix find method
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri-voloshyn committed Apr 2, 2019
1 parent d6570f9 commit ddcced2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Refit/RequestBuilderImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public Func<HttpClient, object[], object> BuildRestResultFuncForMethod(string me
// difficult to upcast Task<object> to an arbitrary T, especially
// if you need to AOT everything, so we need to reflectively
// invoke buildTaskFuncForMethod.
var taskFuncMi = GetType().GetMethod(nameof(BuildTaskFuncForMethod), BindingFlags.NonPublic | BindingFlags.Instance);
var taskFuncMi = typeof(RequestBuilderImplementation).GetMethod(nameof(BuildTaskFuncForMethod), BindingFlags.NonPublic | BindingFlags.Instance);
var taskFunc = (MulticastDelegate)(restMethod.IsApiResponse ?
taskFuncMi.MakeGenericMethod(restMethod.SerializedReturnType, restMethod.SerializedGenericArgument) :
taskFuncMi.MakeGenericMethod(restMethod.SerializedReturnType, restMethod.SerializedReturnType)).Invoke(this, new[] { restMethod });
Expand All @@ -167,7 +167,7 @@ public Func<HttpClient, object[], object> BuildRestResultFuncForMethod(string me
}

// Same deal
var rxFuncMi = GetType().GetMethod(nameof(BuildRxFuncForMethod), BindingFlags.NonPublic | BindingFlags.Instance);
var rxFuncMi = typeof(RequestBuilderImplementation).GetMethod(nameof(BuildRxFuncForMethod), BindingFlags.NonPublic | BindingFlags.Instance);
var rxFunc = (MulticastDelegate)(restMethod.IsApiResponse ?
rxFuncMi.MakeGenericMethod(restMethod.SerializedReturnType, restMethod.SerializedGenericArgument) :
rxFuncMi.MakeGenericMethod(restMethod.SerializedReturnType, restMethod.SerializedReturnType)).Invoke(this, new[] { restMethod });
Expand Down

0 comments on commit ddcced2

Please sign in to comment.