Go to file
Pranav K ef2dc5024f Add support for JSInvokable methods on generic types (dotnet/extensions#2342)
* Add support for JSInvokable methods on generic types

Prior to this change, DotNetDispatcher cached the MethodInfo on the
generic type definition. Using this would have required MethodInfo.MakeGenericMethod before the method was invoked.
We could separately cache the result of this to avoid the reflection cost per invocation.

Alternatively we could cache static and non-static MethodInfo instances separately which is what this change attempts to do.
The big difference in the outcome is that this requires instance (non-static) JSInvokable methods to be only unique named within
the type hierarchy as opposed to across all static and instance JSInvokable methods in an assembly.

Fixes https://github.com/aspnet/Extensions/issues/1360
Fixes https://github.com/aspnet/AspNetCore/issues/9061
\n\nCommit migrated from 659b604fb2
2019-09-19 10:48:09 -07:00
src Add support for JSInvokable methods on generic types (dotnet/extensions#2342) 2019-09-19 10:48:09 -07:00