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                
#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                

功能说明

支持从服务端获取变更大的配置信息,这些配置信息由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"
  },

生产环境 数据库存储示例

avatar

程序中统一使用方式示例

var connectString=Configuration["ConnectionStrings:DefaultConnection"];

Product 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.

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