Skip to content

Commit

Permalink
修复server端默认注入client配制问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yilei committed Apr 30, 2020
1 parent 94247f7 commit 53e48da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Version>1.4.5</Version>
<PackageId>Grpc.Extensions.AspNetCore</PackageId>
<Version>1.4.6</Version>
<PackageId>FM.Grpc.Extensions.AspNetCore</PackageId>
<Authors>RabbitYi</Authors>
<Description>一个基于GRPC的简单微服务框架
1.服务注册和发现
Expand Down
4 changes: 3 additions & 1 deletion src/Grpc.Extension.Client/Grpc.Extension.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
5.DashBoard(远程调用,手动熔断,日志输出控制)
6.Grpc CodeFirst</Description>
<Company />
<Version>1.4.5</Version>
<Version>1.4.6</Version>
<RepositoryType>git</RepositoryType>
<PackageTags>grpc,dashboard,consul,micorservice,opentracing,polly</PackageTags>
<RepositoryUrl>https://github.com/yileicn/Grpc.Extensions/</RepositoryUrl>
<AssemblyVersion>1.4.6.0</AssemblyVersion>
<FileVersion>1.4.6.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
3 changes: 2 additions & 1 deletion src/Grpc.Extension.Client/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static class ServiceCollectionExtensions
public static IServiceCollection AddGrpcClientExtensions(this IServiceCollection services, IConfiguration conf)
{
//注入配制
services.Configure<GrpcClientOptions>(conf.GetSection("GrpcClient"));
var key = conf["GrpcServer:ServiceAddress"] != null ? "GrpcServer" : "GrpcClient";
services.Configure<GrpcClientOptions>(conf.GetSection(key));
//GrpcClientApp
services.AddSingleton<GrpcClientApp>();
//添加客户端中间件的CallInvoker
Expand Down
6 changes: 3 additions & 3 deletions src/Grpc.Extension/Grpc.Extension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.4.5</Version>
<Version>1.4.6</Version>
<Description>一个基于GRPC的简单微服务框架
1.服务注册和发现
2.服务自动负载均衡
Expand All @@ -16,8 +16,8 @@
<Product>Grpc.Extensions</Product>
<Company></Company>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<AssemblyVersion>1.4.1.0</AssemblyVersion>
<FileVersion>1.4.1.0</FileVersion>
<AssemblyVersion>1.4.6.0</AssemblyVersion>
<FileVersion>1.4.6.0</FileVersion>
<RepositoryType>git</RepositoryType>
<PackageTags>grpc,dashboard,consul,micorservice,opentracing,polly</PackageTags>
<PackageProjectUrl>https://github.com/yileicn/Grpc.Extensions/</PackageProjectUrl>
Expand Down

0 comments on commit 53e48da

Please sign in to comment.