You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to dynamic add methods to RpcRouteMetaData,but StaticRpcMethodDataAccessor is internal and I have to implemant IRpcMethodProvider myself. The problem is the RpcEndpointBuilder cannot be extented, and if I add a new UseJsonRpc method with MyRpcEndpointBuilder, I have to create another RpcHttpRouter because it is internal also.
The text was updated successfully, but these errors were encountered:
This should be able to be done, just not with using any of the built in extension methods. Youll need to register a new IRpcMethodProvider in the servicecollection before calling AddJsonRpc(). Then if you call
This should be able to be done, just not with using any of the built in extension methods. Youll need to register a new IRpcMethodProvider in the servicecollection before calling AddJsonRpc(). Then if you call
for applicationbuilder, it should work for you. Try it out. if it doesnt work then i can fix it and/or add a helper method to the BuilderExtensions
Thanks, I fix it out with a RpcEndpointContainer like RpcEndpointBuilder and use a new UserJsonRpcRouter replace the UserJsonRpc method.
If the internal RpcRouteMetaData Resolve() changed to protected, it will be extended easier.
publicstaticIApplicationBuilderUseJsonRpcRouter(thisIApplicationBuilderapp,Action<RpcEndpointContainer>configure=null){varcontainer=app.ApplicationServices.GetService<RpcEndpointContainer>();if(container==null)thrownewInvalidOperationException("AddJsonRpcRouter() needs to be called in the ConfigureServices method.");configure?.Invoke(container);returnapp.UseJsonRpc(options =>{});// the options of RpcEndpointBuilder is no use here}
Gekctek
changed the title
can RpcEndpointBuilder change method Resolve to internal protected?
Add Helper builder extension to use custom MethodProviders
Nov 14, 2020
I want to dynamic add methods to RpcRouteMetaData,but StaticRpcMethodDataAccessor is internal and I have to implemant IRpcMethodProvider myself. The problem is the RpcEndpointBuilder cannot be extented, and if I add a new UseJsonRpc method with MyRpcEndpointBuilder, I have to create another RpcHttpRouter because it is internal also.
The text was updated successfully, but these errors were encountered: