Glodon.IM.DynamicAllocation
1.0.0
dotnet add package Glodon.IM.DynamicAllocation --version 1.0.0
NuGet\Install-Package Glodon.IM.DynamicAllocation -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Glodon.IM.DynamicAllocation" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Glodon.IM.DynamicAllocation --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Glodon.IM.DynamicAllocation, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Glodon.IM.DynamicAllocation as a Cake Addin #addin nuget:?package=Glodon.IM.DynamicAllocation&version=1.0.0 // Install Glodon.IM.DynamicAllocation as a Cake Tool #tool nuget:?package=Glodon.IM.DynamicAllocation&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
功能说明
支持从服务端获取变更大的配置信息,这些配置信息由appsetting.json移到的服务器。
Nuget 安装
Install-Package Glodon.IM.DynamicAllocation -Version 1.0.0
Startup.cs
//注入服务的配置依赖
services.AddIMDynamicAllocation(Configuration);
//使用服务,方法内部从服务器获取配置。
//获取到的配置默认存储在Configuration中,也可以使用重载方法手动处理响应结果
services.UseIMDynamicAllocation();
appsettings.json
// 支持在 系统环境变量、appsettings.json 中设置必要的配置信息
"GXT_ADDRESS": "http://127.0.0.1:5019/api/DynamicAllocation/GetConfig",
"GXT_SERVICENUMBER": "cb80a062-ba3e-49cf-9eb7-bbd6600a1430",
"GXT_APPKEY": "3ff8ca63a70e08414ce09c8ce911595a",
"GXT_COPYNUMBER": "29",
开发环境 appsettings.json 示例
"ConnectionStrings": {
"DefaultConnection": "Database=message;Data Source=127.0.0.1;User Id=root;Password=123;pooling=false;CharSet=utf8;port=3306"
},
生产环境 数据库存储示例
程序中统一使用方式示例
var connectString=Configuration["ConnectionStrings:DefaultConnection"];
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.1
- Microsoft.AspNetCore.Http.Abstractions (>= 2.1.1)
- Microsoft.Extensions.DependencyInjection (>= 2.1.1)
- Microsoft.Extensions.Http (>= 2.1.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.1.1)
- Newtonsoft.Json (>= 11.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 670 | 1/23/2019 |