@@ -14,13 +14,13 @@ namespace DotNetCoreRpc.Server
1414{
1515 public class DotNetCoreRpcMiddleware
1616 {
17- private readonly IDictionary < string , Type > _types ;
17+ private readonly IDictionary < string , Type > _serviceTypes ;
1818 private readonly IEnumerable < Type > _filterTypes ;
1919 private readonly ConcurrentDictionary < string , List < RpcFilterAttribute > > _methodFilters = new ConcurrentDictionary < string , List < RpcFilterAttribute > > ( ) ;
2020
2121 public DotNetCoreRpcMiddleware ( RequestDelegate next , RpcServerOptions rpcServerOptions )
2222 {
23- _types = rpcServerOptions . GetRegisterTypes ( ) ;
23+ _serviceTypes = rpcServerOptions . GetRegisterTypes ( ) ;
2424 _filterTypes = rpcServerOptions . GetFilterTypes ( ) ;
2525 }
2626
@@ -43,7 +43,7 @@ public async Task InvokeAsync(HttpContext context)
4343 return ;
4444 }
4545
46- if ( ! _types . ContainsKey ( requestModel . TypeFullName ) )
46+ if ( ! _serviceTypes . ContainsKey ( requestModel . TypeFullName ) )
4747 {
4848 responseModel . Message = $ "{ requestModel . TypeFullName } 未注册";
4949 await context . Response . WriteAsync ( responseModel . ToJson ( ) ) ;
@@ -60,7 +60,7 @@ public async Task InvokeAsync(HttpContext context)
6060 /// <returns></returns>
6161 private async Task HandleRequest ( HttpContext context , RequestModel requestModel )
6262 {
63- Type serviceType = _types [ requestModel . TypeFullName ] ;
63+ Type serviceType = _serviceTypes [ requestModel . TypeFullName ] ;
6464 var instance = context . RequestServices . GetService ( serviceType ) ;
6565 var instanceType = instance . GetType ( ) ;
6666 var method = instanceType . GetMethod ( requestModel . MethodName ) ;
0 commit comments