コード例 #1
0
 public HomeController(ILogger <HomeController> logger, IAlipayClient client, IOptions <AlipayOptions> optionsAccessor, ServerDiagnosticInterceptor interceptor)
 {
     _logger          = logger;
     _client          = client;
     _optionsAccessor = optionsAccessor;
     _Interceptor     = interceptor ?? throw new ArgumentNullException(nameof(interceptor));;
 }
コード例 #2
0
ファイル: Startup.cs プロジェクト: bluexray/Horizon.Sample
        public void UseGrpcTrack()
        {
            var services = new ServiceCollection();
            var provider = services.BuildServiceProvider();


            var p = provider.GetRequiredService <ServerDiagnosticInterceptor>();

            if (p != null)
            {
                Interceptor = p;
            }
            //var interceptor = provider.GetRequiredService<ServerDiagnosticInterceptor>();
            if (Interceptor != null)
            {
                // Interceptor = interceptor;
            }

            //services.AddSingleton((container) =>
            //{
            //    var logger = container.GetRequiredService<ServerDiagnosticInterceptor>();
            //    return Interceptor=logger;
            //});
        }