From a79d56fbbeab2ded069ca22818139933fb4fb2b4 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 31 Jan 2022 18:51:10 +0300 Subject: [PATCH] Swapped to IOptionsMonitor instead of IRemoteServiceConfiguration --- .../BasketServiceApplicationModule.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/basket/src/EShopOnAbp.BasketService.Application/BasketServiceApplicationModule.cs b/services/basket/src/EShopOnAbp.BasketService.Application/BasketServiceApplicationModule.cs index 2cf26502..74a9e542 100644 --- a/services/basket/src/EShopOnAbp.BasketService.Application/BasketServiceApplicationModule.cs +++ b/services/basket/src/EShopOnAbp.BasketService.Application/BasketServiceApplicationModule.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using EShopOnAbp.CatalogService; using EShopOnAbp.CatalogService.Grpc; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using Volo.Abp.Application; using Volo.Abp.AutoMapper; using Volo.Abp.Http.Client; @@ -27,10 +28,10 @@ namespace EShopOnAbp.BasketService options.AddMaps(); }); - context.Services.AddGrpcClient((services, options) => + context.Services.AddGrpcClient((services, options) => { - var remoteServiceConfigurationProvider = services.GetRequiredService(); - var catalogServiceConfiguration = remoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync("Catalog").Result; + var remoteServiceOptions = services.GetRequiredService>().CurrentValue; + var catalogServiceConfiguration = remoteServiceOptions.RemoteServices.GetConfigurationOrDefault("Catalog"); var catalogGrpcUrl = catalogServiceConfiguration.GetOrDefault("GrpcUrl"); options.Address = new Uri(catalogGrpcUrl);