dotnetcore / AgileConfig

基于.NET Core开发的轻量级分布式配置中心 / .NET Core lightweight configuration server
MIT License
1.5k stars 299 forks source link

服务注册中的ServiceName可以自动默认为appId吗 #176

Open a34546 opened 5 months ago

a34546 commented 5 months ago

服务注册时,如果不填写ServiceName时会报错,我希望如果只填写serverId,没有填写serverName时,默认将AppId作为默认值。 我现在使用场景就是全部填写的appId,但是感觉和上面的AppId重复,想省略掉, 想在注册UseAgileConfig前自动赋值,但是还是不生效 builder.Configuration["AgileConfig:serviceRegister:serviceName"]=builder.Configuration["AgileConfig:appId"] 但是还是会报错。有什么好的办法解决吗

a34546 commented 5 months ago

或者取消必填也可以

kklldog commented 5 months ago

不错的建议。这两天我会进行优化。